home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / tclib20.zip / TCHK.DOC < prev    next >
Text File  |  1988-12-03  |  346KB  |  17,097 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                        TCHK - a Turbo C library
  22.  
  23.                              Version 2.00
  24.  
  25.                         Documentation for TCHK
  26.  
  27.                                   by
  28.  
  29.                            Howard Kapustein
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                            Howard Kapustein
  36.  
  37.                            1695 Barbara Lane
  38.  
  39.                          East Meadow, NY 11554
  40.  
  41.                             (516) 481-9612
  42.  
  43.  
  44.  
  45.              (c) Copyright 1987, 1988, All rights reserved
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.      TCHK 2.0                                               Page 1
  74.  
  75.                              Table of Contents
  76.   
  77.   
  78.   COPYRIGHT AND DISCLAIMER  ..........................................   7
  79.   
  80.   TRADEMARKS  ........................................................   7
  81.   
  82.   LICENSE  ...........................................................   7
  83.   
  84.   BACKGROUND  ........................................................   8
  85.   
  86.   FILES  .............................................................   9
  87.   
  88.   IN THE BEGINNING..  ................................................  10
  89.   
  90.   FEATURES  ..........................................................  11
  91.   
  92.   CREDIT  ............................................................  11
  93.   
  94.   FUNCTIONS  .........................................................  11
  95.        accum_dep - calculate accumulated depreciation  ...............  14
  96.        ansi_call - create an ANSI escape sequence  ...................  15
  97.        ansiback - convert DOS background code to ANSI  ...............  17
  98.        ansifore - convert DOS foreground code to ANSI  ...............  18
  99.        atrim - trims leading and trailing blanks  ....................  19
  100.        average - calculate the average of a set of reals  ............  20
  101.        beep - generate a standard IBM PC beep  .......................  21
  102.        box - draw a box  .............................................  22
  103.        boxwindow - draw a 'window'  ..................................  23
  104.        Cal... - family of Calendar date conversions  .................  25
  105.        CapsLock - set the Caps Lock key state  .......................  26
  106.        changelitebar - set internal litebar menu   ...................  27
  107.        clear - clears a portion of the screen  .......................  28
  108.        clear_typeahead - clear typeahead buffer  .....................  29
  109.        cls - clear screen  ...........................................  30
  110.        color - make a single attribute  ..............................  31
  111.        cpu_id - identify the cpu  ....................................  32
  112.        cursor_blink - set speed of cursor blink  .....................  33
  113.        cursor_flip - toggle the cursor type  .........................  34
  114.        cursor_off - turn the cursor off  .............................  35
  115.        cursor_on - turn the cursor on  ...............................  36
  116.        date_convert - convert date formats  ..........................  37
  117.        dayofweek - find the day of the week  .........................  38
  118.        dayofyear - calculate the day of the year  ....................  39
  119.        daysleft - calculate the days left in the year  ...............  40
  120.        ddatetofull - convert a date to full string  ..................  41
  121.        ddatetoshort - convert a date to short string  ................  42
  122.        ddatetostr - convert a date to abbrev. string  ................  43
  123.        depreciation - calculate depreciation for a  ..................  44
  124.        DESQcommonmem - returns measure of common memory  .............  45
  125.        DESQconvenmem - returns measure of conventional  ..............  46
  126.        DESQdispchar - displays a char on the status line  ............  47
  127.        DESQexit - exit program in DESQview  ..........................  48
  128.        DESQexpandedmem - returns measure of expanded  ................  49
  129.   
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.      TCHK 2.0                                               Page 2
  140.  
  141.        DESQfreeCPU - give up CPU time  ...............................  50
  142.        DESQInternalStack - switch to DESQview's internal  ............  51
  143.        DESQMakeTone - makes a tone under DESQview  ...................  52
  144.        DESQProgramStack -  switch back to program's  .................  53
  145.        DESQversion - DESQview version  ...............................  54
  146.        diffddate - calculate the difference in 2 dates  ..............  55
  147.        diskchanged - has the disk has been changed  ..................  56
  148.        disktype - identify disk type  ................................  57
  149.        dosday - extract day from file date stamp  ....................  58
  150.        doshour - extract hour from file time stamp  ..................  59
  151.        dosmonth - extract hour from file date stamp  .................  60
  152.        dosmin - extract minutes from file time stamp  ................  61
  153.        dossec - extract seconds from file time stamp  ................  62
  154.        dosyear - extract year from file date stamp  ..................  63
  155.        double_decline_bal_dep - calculate double  ....................  64
  156.        DoubleDOSfreeCPU - give up CPU time under  ....................  65
  157.        DoubleDOSGetVirtual - get DoubleDOS virtual  ..................  66
  158.        DoubleDOSTaskSwitch - set Double DOS task  ....................  67
  159.        EMMversion - version of Expanded Memory Manager  ..............  68
  160.        EMSinfo - determines EMM version and EMS pages  ...............  69
  161.        EMSpages - determines the total and available  ................  70
  162.        EMSwarmbootprep - prepares the EMM for warm boot  .............  71
  163.        endstri - get offset to last char of a string  ................  72
  164.        endstrp - get pointer to last char of a string  ...............  73
  165.        expandfilespec - expand a filespec into a full  ...............  74
  166.        Extendedtotal - total Extended memory installed  ..............  75
  167.        factorial - determines a factorial (n!)  ......................  76
  168.        fname_match - compare filenames w/wildcards  ..................  77
  169.        fncmp - compare filenames w/wildcards  ........................  78
  170.        frac - round the fractional portion of a real  ................  79
  171.        fsgn - sign of a real  ........................................  80
  172.        fulltoddate - convert a full date to struct  ..................  81
  173.        FV - calculate the Future Value of a single amount  ...........  82
  174.        FVa - calculate the Future Value of an annuity  ...............  83
  175.        getBootBlock - get Boot Block  ................................  84
  176.        getBPB - get Bios Parameter Block  ............................  85
  177.        getc_match - get specific input, case dependent  ..............  86
  178.        getci_match - get specific input, case  .......................  87
  179.        getcursor - gets cursor scan lines  ...........................  88
  180.        getdatehk - inputs a date from the keyboard  ..................  89
  181.        getdouble - inputs a double from the keyboard  ................  90
  182.        getEMSstatus - get Expanded Memory status  ....................  91
  183.        getfilespec - get a DIR proper filespec  ......................  92
  184.        getfname - get a filename from the keyboard  ..................  93
  185.        getget - get a string from the keyboard w/editing  ............  94
  186.        getint - inputs an integer from the keyboard  .................  96
  187.        getk - get a key  .............................................  97
  188.        getlogical - get Yes/No  ......................................  98
  189.        getreal - inputs a real from the keyboard  ....................  99
  190.        getstr - input a string from the keyboard  .................... 100
  191.        getyn - get Yes/No  ........................................... 101
  192.        gotohv - move cursor to absolute coordinates  ................. 102
  193.        Greg... - family of Gregorian date conversion  ................ 103
  194.        horiz_line - draw a horizontal line  .......................... 104
  195.   
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.      TCHK 2.0                                               Page 3
  206.  
  207.        inkey - get a key  ............................................ 105
  208.        inkeyc - get a key, any alphabetics capitalized  .............. 106
  209.        intlen - calculate length of integer in a string  ............. 107
  210.        InsLock - set the Insert key state  ........................... 108
  211.        isAppendavail - is APPEND installed  .......................... 109
  212.        isAssignavail - is ASSIGN installed  .......................... 110
  213.        isBlogical - is drive B: logical  ............................. 111
  214.        isBREAKon - check Ctrl-BREAK flag  ............................ 112
  215.        isCGA - is Color Graphics adapter installed  .................. 113
  216.        isEGA - is Enhanced Graphics adapter installed  ............... 113
  217.        isHerc - is Hercules Graphics adapter installed  .............. 113
  218.        isMDA - is Monochrome adapter installed  ...................... 113
  219.        ismono - is monochrome display  ............................... 113
  220.        iscolor - is color display  ................................... 113
  221.        isdir - is a FAT entry a subdirectory  ........................ 114
  222.        isEMSavail - is EMS available  ................................ 115
  223.        isExtended - is Extended memory installed  .................... 116
  224.        isgameport - is a game port installed  ........................ 117
  225.        isgn - sign of an integer  .................................... 118
  226.        iskey102 - is an enhanced keyboard installed  ................. 119
  227.        isleapyear - is a year a leap year  ........................... 120
  228.        isNetwork - is a network installed  ........................... 121
  229.        isPRINTavail - is PRINT.COM installed  ........................ 122
  230.        isPM - the the hour AM or PM  ................................. 123
  231.        isShareavail - is SHARE installed  ............................ 124
  232.        isVERIFYon - check VERIFY flag  ............................... 125
  233.        isVidclock - is VIDCLOCK.COM by Tom Hanlin  ................... 126
  234.        Jul... - family of Julian date conversion  .................... 127
  235.        leftstr - return the left portion of a string  ................ 128
  236.        litebar_alloc - allocate memory for a litebar  ................ 129
  237.        litebar_free - frees memory allocated by a  ................... 133
  238.        litebar_get - get user's choice from a litebar  ............... 134
  239.        litehilite - hilite a litebar menu command  ................... 135
  240.        litemessage - change the message for a litebar  ............... 136
  241.        liteunlite - unhilite a litebar menu command  ................. 137
  242.        lsgn - sign of a long integer  ................................ 138
  243.        ltrim - trims leading blanks  ................................. 139
  244.        lotus_setup - creates info for menu_lotus()  .................. 140
  245.        machine_id - determine machine type  .......................... 141
  246.        memory_strategy - get/set memory alloc strategy  .............. 142
  247.        menu_lotus - Lotus style menu  ................................ 143
  248.        menu_popup - popup style menu  ................................ 145
  249.        mid - is a number within a range  ............................. 146
  250.        midstr - return the middle portion of a string  ............... 147
  251.        monthexpand - convert a month abbrev to its name  ............. 148
  252.        ndp_id - identify the math coprocessor  ....................... 149
  253.        NumLock - set the Num Lock key state  ......................... 150
  254.        parsefilename - parses a filename, supports paths  ............ 151
  255.        parsefnameext - parses a filename into name and  .............. 153
  256.        pause - wait for a time or until a keypress  .................. 154
  257.        PMT - calculate the periodic payment required to  ............. 155
  258.        popup_alloc - allocate memory for a popup menu  ............... 156
  259.        popup_free - frees memory allocated by popup menu  ............ 159
  260.        popup_get - get user's choice from a popup menu  .............. 160
  261.   
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.      TCHK 2.0                                               Page 4
  272.  
  273.        popup_restore - restore video from a popup menu  .............. 161
  274.        popup_setcurrent - set internal popup menu  ................... 162
  275.        pophilite - hilite a popup menu command  ...................... 163
  276.        popunlite - unhilite a popup menu command  .................... 164
  277.        print_screen - issue a PrintScreen  ........................... 165
  278.        PRINTadd - add a file to the print queue  ..................... 166
  279.        PRINThold - hold print queue for status read  ................. 167
  280.        PRINTpurge - remove all files from print queue  ............... 168
  281.        PRINTremove - remove a file from print queue  ................. 169
  282.        PRINTresume - resume printing after a PRINThold  .............. 170
  283.        putk - put a character w/attribute on the screen  ............. 171
  284.        putsay - put a string with attribute on the  .................. 172
  285.        putstr - put string with attribute on the screen  ............. 173
  286.        PV - calculate the Present Value of a single  ................. 174
  287.        PVa - calculate the Present Value of an annuity  .............. 175
  288.        read_attrib - gets the attribute under the cursor  ............ 176
  289.        read_char - gets the character under the cursor  .............. 177
  290.        read_cursor - reads cursor information  ....................... 178
  291.        read_mode - find screen width, mode and page  ................. 179
  292.        reboot - reboots the machine  ................................. 180
  293.        rightstr - return the right portion of a string  .............. 181
  294.        ROM_date - gets the ROM id date  .............................. 182
  295.        ROM_id - gets the ROM id byte  ................................ 183
  296.        round - round a real to a decimal place  ...................... 184
  297.        rtrim - trims trailing blanks  ................................ 185
  298.        scrbuff - calculate size of screen buffer  .................... 186
  299.        scroll_down - scroll window down  ............................. 187
  300.        scroll_up - scroll window up  ................................. 188
  301.        ScrollLock - set the Scroll Lock key state  ................... 189
  302.        set_color - set the default attribute (color)  ................ 190
  303.        set_cursor - sets cursor scan lines  .......................... 191
  304.        set_handles - set handle count  ............................... 192
  305.        set_mode - set the video mode  ................................ 193
  306.        setBREAK - set Ctrl-BREAK flag  ............................... 194
  307.        setcursor - sets cursor scan lines  ........................... 195
  308.        settextinfo - set text mode video information  ................ 196
  309.        setVERIFY - set VERIFY flag  .................................. 197
  310.        shorttoddate - convert a short date to struct  ................ 198
  311.        sqr - square of a value  ...................................... 199
  312.        stddev - calculate the standard deviation of a  ............... 200
  313.        straight_line_dep - calculate straight line  .................. 201
  314.        strcapital - capitalizes the first letter of each  ............ 202
  315.        strclean - remove non-printable ASCII codes  .................. 203
  316.        strcomma - convert a string to xx,xxx,xxx format  ............. 204
  317.        strdel - delete part of a string  ............................. 205
  318.        strfill - fill a string with a character  ..................... 206
  319.        strins - insert one string into another  ...................... 207
  320.        stroccur - count the occurences of a substring  ............... 208
  321.        strrep - replicate a char  .................................... 209
  322.        strshleft - shift string left  ................................ 210
  323.        strshright - shift string right  .............................. 211
  324.        strtocomma - convert a string to xx,xxx format  ............... 212
  325.        strtoddate - convert a date string to a structure  ............ 213
  326.        strtodol - converts a string to dollar format  ................ 214
  327.   
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.      TCHK 2.0                                               Page 5
  338.  
  339.        strtotime - convert a string to a time structure  ............. 215
  340.        strwcmp - compares a wild-carded string to  ................... 216
  341.        strwicmp - compares a wild-carded string to  .................. 217
  342.        sum_year_digits_dep - calculate sum of the years  ............. 218
  343.        summation - calculate a summation of integers  ................ 219
  344.        swap - swap two values  ....................................... 220
  345.        time_convert - convert time formats  .......................... 221
  346.        timetostr - convert time structure to a string  ............... 222
  347.        tocapkey - convert the key code to uppercase  ................. 223
  348.        to24hour - converts hours to 24-hour format  .................. 224
  349.        todosdate - make a DOS file date stamp  ....................... 225
  350.        todostime - make a DOS file time stamp  ....................... 226
  351.        tohour - converts 24-hour format to 12-hour  .................. 227
  352.        valid_date - check if a date is valid  ........................ 228
  353.        variance - calculate the variance of a set of  ................ 229
  354.        vert_line - draw a vertical line  ............................. 230
  355.        whereh - X-coordinate of cursor   ............................. 231
  356.        wherev - Y-coordinate of cursor   ............................. 232
  357.   
  358.   #DEFINES  .......................................................... 233
  359.        Ansihk.h  ..................................................... 233
  360.        Color.h  ...................................................... 233
  361.        Chiphk.h  ..................................................... 233
  362.        Datehk.h  ..................................................... 233
  363.        Doshk.h  ...................................................... 234
  364.        Filehk.h  ..................................................... 234
  365.        Finance.h  .................................................... 235
  366.        Howard.h  ..................................................... 235
  367.        Ibm.h  ........................................................ 235
  368.        Keyboard.h  ................................................... 236
  369.        Keycode.h  .................................................... 236
  370.        Math.h  ....................................................... 236
  371.        Menuhk.h  ..................................................... 237
  372.        Multihk.h  .................................................... 239
  373.        Printhk.h  .................................................... 239
  374.        Video.h  ...................................................... 239
  375.   
  376.   VARIABLE TYPES  .................................................... 239
  377.   
  378.   GLOBAL VARIABLES  .................................................. 240
  379.        Date variables:  .............................................. 240
  380.        Keyboard variables:  .......................................... 240
  381.        Multitasking variables:  ...................................... 240
  382.        TCHK version variables:  ...................................... 241
  383.        Video variables:  ............................................. 241
  384.   
  385.   REVISION HISTORY  .................................................. 242
  386.   
  387.   FUTURE ENHANCEMENTS  ............................................... 245
  388.   
  389.   OTHER PRODUCTS  .................................................... 246
  390.   
  391.   SUPPORT  ........................................................... 246
  392.   
  393.   
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.      TCHK 2.0                                               Page 6
  404.  
  405.   APPENDIX A - DATE FORMATS  ......................................... 248
  406.   
  407.   APPENDIX B - date_convert() FORMATS  ............................... 249
  408.   
  409.   APPENDIX C - time_convert() FORMATS  ............................... 251
  410.   
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.      TCHK 2.0                                               Page 7
  470.  
  471.   
  472.   
  473.                           COPYRIGHT AND DISCLAIMER
  474.   
  475.        This library and documentation are Copyrighted (C) 1987, 1988 by
  476.        Howard Kapustein, All Rights Reserved.
  477.   
  478.        Use of this library acknowledges this disclaimer of warranty:
  479.        "This library is supplied as-is. The author disclaims all
  480.        warranties, expressed or implied, including, without limitation,
  481.        the warranties of merchantability and of fitness of this library
  482.        for any purpose. The author assumes no liability for damages
  483.        direct or consequential, which may result from the use of this
  484.        library."
  485.   
  486.   
  487.   
  488.                                  TRADEMARKS
  489.   
  490.         Macintosh is a registered trademark of Apple Incorporated.
  491.      dBase III+ is a registered trademark of Ashton-Tate Incorporated.
  492.         TLIB, Turbo C and Turbo Assembler are registered trademarks
  493.                          of Borland International.
  494.              Symphony is a registered trademark of Lotus Corp.
  495.      DESQview is a registered trademark of Quarterdeck Office Systems.
  496.   
  497.   
  498.   
  499.                                   LICENSE
  500.   
  501.        TCHK is NOT public domain or free software, but is being
  502.        distributed as "shareware" or "user supported" software, as
  503.        outlined below.
  504.   
  505.        Non-registered users are granted a limited license to make an
  506.        evaluation copy for trial use on a private, non-commercial basis,
  507.        for the express purpose of determining whether TCHK is suitable
  508.        for their needs. At the end of this period you should either
  509.        register your copy or discontinue using TCHK as well as products
  510.        designed with unregistered versions of TCHK.
  511.   
  512.        In english for those of you without law degrees, if you use TCHK
  513.        in developing some program you should pay for your copy of TCHK.
  514.        This way I'll be able to provide you with support, updates and
  515.        still feed myself.
  516.   
  517.        Users may become REGISTERED owners for the small pittance of $15.
  518.        Registering has the following benefits:
  519.   
  520.             Registered owners will receive TCHK compiled for use with all
  521.             memory models (not just the small memory model distributed
  522.             here.)
  523.   
  524.   
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.      TCHK 2.0                                               Page 8
  536.  
  537.             Registered owners are entitled to utilize TCHK in commercial
  538.             applications.
  539.   
  540.             Registered owners will receive disk documentation and
  541.             libraries compiled for all memory models up to, and
  542.             including, the next non-trivial version increase (i.e. if you
  543.             register for 2.01, you will receive all versions from 2.01 to
  544.             2.1. If versions 2.01, 2.02 and 3.0 are released, you will
  545.             receive 2.01, 2.02 and 3.0).
  546.   
  547.        REGISTERED owners may purchase the source code to TCHK for $35.
  548.   
  549.        Businesses using TCHK, for whatever reason, MUST register.
  550.   
  551.        Distribution of a program incorporating an unregistered version of
  552.        TCHK, in part or whole, is a violation of the law.
  553.   
  554.        All users are granted a limited license to copy TCHK only for the
  555.        trial use of others and subject to the above limitations. This
  556.        license does NOT include distribution or copying of this software
  557.        package:
  558.   
  559.             1 -  In connection with any other product or service.
  560.             2 -  For general use within a company or institution.
  561.             3 -  For any consideration or 'disk fee'.
  562.             4 -  In modified form, i.e. the file containing this license
  563.                  information MUST be included, along with the full TCHK
  564.                  documentation.
  565.   
  566.        Operators of electronic bulletin board systems (Sysops) are
  567.        encouraged to post TCHK for downloading by their users, as long as
  568.        the above considerations are met.
  569.   
  570.        If you are a distributor of a public domain or user-supported
  571.        software library, you may be eligible to distribute copies of
  572.        TCHK. You must meet all of the above conditions and acquire
  573.        written permission from me, the author (Howard Kapustein) before
  574.        doing so. Such permission is usually granted. Please call or write
  575.        for details.
  576.   
  577.   
  578.   
  579.                                  BACKGROUND
  580.   
  581.        I am a senior at Rensselaer Polytechnic Institute majoring in
  582.        computer science. I also do consulting/programming work as a
  583.        sideline (hint hint.) When I purchased Turbo C (way back at
  584.        version 1.0), I wanted to do more than bare bones printf(). I was
  585.        also engaged in designing some software requiring the use of
  586.        dates, and some other unusual functions. Thus, after several
  587.        months of testing and use, I developed a rather useful collection
  588.        of functions. After some requests from other programmers, I
  589.        decided to bundle most of them together and <gasp> document them.
  590.        Since then, my library has grown, and so has TCHK. This library is
  591.        a collection of most of these functions.
  592.   
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.      TCHK 2.0                                               Page 9
  602.  
  603.   
  604.   
  605.   
  606.                                    FILES
  607.   
  608.        You may not distribute TCHK except in unmodified form, and it must
  609.        be distributed with all the following files:
  610.   
  611.             READ.ME        - last minute notes
  612.             TCHK.DOC       - TCHK documentation
  613.             TCHK.REG       - TCHK registration form
  614.             TCHK.TC        - Turbo C configuration file
  615.             TCHKS.LIB      - small memory model library
  616.   
  617.             ANSIHK.H       - header file for ANSI functions
  618.             CHIPHK.H       - header file for chip id routines
  619.             COLOR.H        - color definitions
  620.             DATEADV.H      - header file for advanced date routines
  621.             DATECONV.H     - header file for date conversion routines
  622.             DATEHK.H       - header file for date routines
  623.             DOSHK.H        - header file for DOS routines
  624.             FILEHK.H       - header file for file routines
  625.             FINANCE.H      - header file for financial routines
  626.             IBM.H          - header file for misc. IBM routines
  627.             KEYBOARD.H     - header file for keyboard routines
  628.             KEYCODE.H      - keyboard key codes
  629.             MATHHK.H       - header file of math routines
  630.             MENUHK.H       - header file for menu routines
  631.             MULTIHK.H      - header file for multi-tasking routines
  632.             PRINTHK.H      - header file for print routines
  633.             STRINGHK.H     - header file for string routines
  634.             TIMEHK.H       - header file for time routines
  635.             VIDEO.H        - header file for video routines
  636.   
  637.             DEMO.ARC       - archive of TCHK demo programs:
  638.   
  639.                  DEMOADV.C      - date conversion functions
  640.                  DEMOADV.PRJ
  641.                  DEMODATE.C     - date functions
  642.                  DEMODATE.PRJ
  643.                  DEMODISK.C     - disktype function
  644.                  DEMODISK.PRJ
  645.                  DEMOLITE.C     - litebar menu functions
  646.                  DEMOLITE.PRJ
  647.                  DEMOLOT.C      - lotus menu functions (see Revisions)
  648.                  DEMOLOT.PRJ
  649.                  DEMONUM.C      - number functions (math/financial)
  650.                  DEMONUM.PRJ
  651.                  DEMOPARS.C     - DOS parsing functions
  652.                  DEMOPARS.PRJ
  653.                  DEMOPOP.C      - popup menu functions
  654.                  DEMOPOP.PRJ
  655.                  DEMOTIME.C     - time conversion functions
  656.                  DEMOTIME.PRJ
  657.   
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.      TCHK 2.0                                               Page 10
  668.  
  669.   
  670.   
  671.        To compile the demo programs, use the configuration file TCHK.TC
  672.        and the appropriate project file. Make sure you check the Turbo C
  673.        directories before compiling.
  674.   
  675.   
  676.   
  677.                             IN THE BEGINNING...
  678.   
  679.        Except where explicitly stated, all of these functions have been
  680.        compiled and tested on my system:
  681.   
  682.              - IBM PC
  683.              - 640K memory
  684.              - (CGA) Color Graphics Adapter
  685.              - DOS 3.2
  686.              - IBM Proprinter XL
  687.              - NEC V20 cpu
  688.              - PC Sprint (dandy little speed up plug in. No slot,
  689.                hardware switch for normal (4.77) and fast (~7) MHz speeds
  690.                and reboot. Between the board and the NEC my machine plods
  691.                along almost 2x as fast as a normal PC. At only $95, I
  692.                highly recommend it. Call these guys for more info:
  693.   
  694.                       Product: PC Sprint and/or NEC V20
  695.                       Exec-PC, Inc.
  696.                       PO BOX 11268
  697.                       Shorewood, WI  53211
  698.                       VOICE: (414) 963-2880
  699.                       MODEM: (414) 964-5160
  700.   
  701.        TCHK was compiled from the interactive environment of Turbo C,
  702.        with the following options changed from the default:
  703.   
  704.             Memory model: SMALL
  705.             Optimize on: SPEED
  706.             Full optimization (Register/Jump)
  707.             No debug information
  708.             Standard stack frame Off
  709.   
  710.   
  711.        For more info, check out the configuration file TCHK.TC.
  712.   
  713.        This library was written in 100% Turbo C, except for a couple of
  714.        TASM modules which were originally inline Assembly. All C code was
  715.        compiled with Turbo C 2.0, all Assembly was compiled with Turbo
  716.        Assembler 1.0 and TCHK created with TLIB 2.0.
  717.   
  718.   
  719.   
  720.   
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.      TCHK 2.0                                               Page 11
  734.  
  735.                                   FEATURES
  736.   
  737.        TCHK sports many useful features not found in other shareware
  738.        packages. Aside from many input and output routines, TCHK is the
  739.        only package I have seen (and I've looked) that supplies date and
  740.        time functions. Also unique to TCHK is the Lotus style slash-bar,
  741.        popup and litebar menu functions.
  742.   
  743.        Many of the functions requiring output as a side effect (most
  744.        noticeably the keyboard functions) make use of some of the output
  745.        routines prototyped in VIDEO.H or some of the console i/o
  746.        functions by Borland (i.e. cputs(), putch(), etc.). If you use
  747.        almost any of the keyboard routines, alse expect some video
  748.        routines to be linked into your program. This is true of some
  749.        other functions as well (the popup menus use Borland's gettext()
  750.        and cputs() routines.) If you really want to change the library,
  751.        you can always purchase the source code...
  752.   
  753.   
  754.   
  755.                                    CREDIT
  756.   
  757.        The following people deserve credit for their help:
  758.   
  759.        James Arnold for helping with optimizing the direct video access
  760.             functions.
  761.        Darius Thabit for his help with the reboot function.
  762.        Mark Seyden, Sysop of The BOSS (201-568-7293), for allowing me
  763.             to use his bbs as a base for TCHK.
  764.        Robert Blacher, Sysop of Computer Connections (202-547-2008),
  765.             for his comments regarding my license information.
  766.   
  767.   
  768.   
  769.                                  FUNCTIONS
  770.   
  771.        Most of the functions are documented well enough below, although I
  772.        feel a few more explanations are necessary:
  773.   
  774.             In the interactive environment you can #define one item in
  775.             terms of another, including spaces. If anyone knows how to do
  776.             this with the command line version, please let me know. The
  777.             variable type  byte  is just an unsigned char. If you use the
  778.             command line version of TC you will have to change the header
  779.             files of TCHK.
  780.   
  781.             Beginning with TCHK 2.0, unless otherwise noted, all
  782.             functions asking for screen coordinates comply with Borland's
  783.             format (x,y). The top left corner of the screen is (1,1).
  784.             This is highly different from previous versions of TCHK.
  785.   
  786.             Most functions rely on interrupts and low memory addresses
  787.             (400:xxxx) to comply  with the IBM standard. Certain values
  788.             (for instance, the current video page) can be found by an 
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.      TCHK 2.0                                               Page 12
  800.  
  801.             interrupt or by peeking at the value stored in low memory.
  802.             Many of the video functions especially require these values
  803.             to be found at the proper places. If your clone is radically
  804.             different from the IBM standard some of these functions may
  805.             not work properly. I didn't want to have to write a million
  806.             small functions that are just background support for the
  807.             functions found here (like current page number, etc.) so I
  808.             used the #defines found in the headers (see video.h for more
  809.             details.)
  810.   
  811.             TCHK considers "key codes", "scan codes" and "ascii codes" as
  812.             different animals. Via the BIOS, any key pressed returns a
  813.             value. If a 'normal' key is pressed (i.e. a letter, space,
  814.             etc.) the low order byte contains the letter. When the low
  815.             order byte is zero, an unusual key has been pressed (i.e. Alt
  816.             combinations, arrows, grey +, etc.) This 2 byte word as
  817.             returned by the BIOS is called a scan code. For ease of use,
  818.             several functions convert this "scan code" to a value from
  819.             0-511, called a "key code", where 0-255 are 'normal' ascii
  820.             codes, as per the IBM ASCII character set, and 256-511 are
  821.             the unusual keys. Many of the popular key codes are listed in
  822.             KEYCODE.H. To determine a key code, if the low order byte is
  823.             zero, take the high order byte as a number 0-255 and add 256.
  824.             If the low order byte is non-zero, take the low order byte as
  825.             a number from 0-255. Note that although the regular plus key
  826.             and the grey plus key (on the numeric keypad) return
  827.             different scan codes, their key code is the same. So,
  828.             briefly, an "ascii code" is a char (value of 0-255), a "scan
  829.             code" is a 2-byte word returned from the BIOS, and a "key
  830.             code" is a value 0-511. "Scan codes" and "key codes" are both
  831.             2 bytes long (unsigned int and int, respectively).
  832.   
  833.             There are several functions that refer to a DOS file name. A
  834.             'file name' is a generic term for any possible name for a
  835.             file (drive, path and even filename.ext are optional). A
  836.             'filename' refers to a DOS filename.ext, no drive or path
  837.             (sometimes referred to with 'filename.ext'). A 'filepathname'
  838.             refers to a full file name, including drive, path and
  839.             filename.ext (some parts may be optional.) A 'filespec' is
  840.             similiar to a 'filename', but does not necessarily refer to a
  841.             specific file (i.e. D:\TURBOC is actually D:\TURBOC\*.*. See
  842.             how DIR parses filespecs for more details.)
  843.   
  844.             TCHK has not been tested on a Hercules or MDA video card
  845.             since I do not have access to either piece of hardware,
  846.             although the methods I used are well documented and should
  847.             cause no problems.
  848.   
  849.             All functions that use my direct screen access routines have
  850.             built-in snow control. On CGA monitors, the snow was
  851.             horrendous without it. Unless I code these routines in
  852.             assembler, I won't be able to squeeze any more optimization
  853.             out of these routines. Since Borland now provides acceptable
  854.             console i/o functions, I doubt I shall bother to recode these
  855.             in Assembler.
  856.   
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.      TCHK 2.0                                               Page 13
  866.  
  867.   
  868.        One type of command you will NOT find in TCHK are windowing
  869.        commands. There are plenty of windowing libraries available. You
  870.        should not try to make your poor IBM into a Mac, it won't cut it.
  871.        Splurge for the Mac, you'll be happier. If you really want windows
  872.        on your IBM-type machine, use DESQview. Yes, I know, the
  873.        'windowing' interface is nicer. I use 'windows' too, although mine
  874.        are just boxes. I find it more than suitable for my current needs.
  875.   
  876.        The functions are listed in the same manner as the Turbo C manual,
  877.        in alphabetical order.
  878.   
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.      TCHK 2.0                                               Page 14
  932.  
  933.   
  934.   Function             accum_dep - calculate accumulated depreciation
  935.   
  936.   Syntax              double accum_dep(double cost, double salvage, int
  937.                                        life, int period, int dtype);
  938.   
  939.   Prototype in        finance.h
  940.   
  941.   Remarks             given the cost, salvage value and life of an item,
  942.                       accum_dep will calculate the amount of accumulated
  943.                       depreciation for the given period according to the
  944.                       depreciation method specified by dtype. The cost
  945.                       and salvage can be given in any unit (dollars,
  946.                       thousands of dollars, etc.) but the life should be
  947.                       given in depreciable periods (if you depreciate an
  948.                       item every quarter, and the item has a life of 2
  949.                       years, then life should be 8).
  950.   
  951.                       The cost and salvage values should be in the same
  952.                       units. The life and period should be given in the
  953.                       same units.
  954.   
  955.                       Types of depreciation supported by the variable
  956.                       dtype are:
  957.   
  958.                            1 -  Straight line depreciation
  959.                            2 -  Sum of the years digits depreciation
  960.                            3 -  Double declining balance depreciation
  961.   
  962.                       Any other value for dtype will produce
  963.                       unpredictable results.
  964.   
  965.                       No error checking is performed.
  966.   
  967.                       This is a generic function to calculate the
  968.                       accumulated depreciation given all necessary
  969.                       information. Any unnecessary information is ignored
  970.                       (i.e. double declining balance does not need a
  971.                       salvage value.)
  972.   
  973.   Return value        returns the amount of depreciation for the given
  974.                       period in the same units as the cost, as per the
  975.                       depreciation method specified by dtype.
  976.   
  977.   Note                The macros ACC_DDB(c,l,p), ACC_SLD(c,s,l) and
  978.                       ACC_SYD(c,s,l,p) are defined in finance.h for ease
  979.                       of use.
  980.   
  981.   See also            accum_dep(), double_decline_bal_dep(),
  982.                       straight_line_dep(), sum_year_digits_dep()
  983.   
  984.   Example             see demonum.c
  985.   
  986.   
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.      TCHK 2.0                                               Page 15
  998.  
  999.   
  1000.   Function             ansi_call - create an ANSI escape sequence
  1001.   
  1002.   Syntax              char *ansi_call(int subfunction, int parm1, int
  1003.                                       parm2, char *ansistring);
  1004.   
  1005.   Prototype in        ansihk.h
  1006.   
  1007.   Remarks             ansi_call is a general function that will create an
  1008.                       ANSI escape sequence for the given subfunction:
  1009.   
  1010.                             1: gotoxy(parm1,parm2)
  1011.                             2: cursor_right
  1012.                             3: cursor_left
  1013.                             4: cursor_up
  1014.                             5: cursor_down
  1015.                             6: save_cursor_position
  1016.                             7: restore_cursor_position
  1017.                             8: cls()
  1018.                             9: clear_eol()
  1019.                            10: set_foreground(parm1)
  1020.                            11: set_background(parm1)
  1021.                            12: clear_attributes     (plain, normal)
  1022.                            13: bold
  1023.                            14: faint
  1024.                            15: italic
  1025.                            16: blink
  1026.                            17: fast_blink
  1027.                            18: inverse
  1028.                            19: invisible
  1029.                            20: set_mode(parm1)
  1030.                            21: reset_mode(parm1)
  1031.                            22: wherexy()
  1032.   
  1033.                            1: moves cursor to (parm1,parm2)
  1034.                          2-5: move cursor 1 space in direction indicated
  1035.                          6-7: save cursor position for future restoring
  1036.                            8: clear screen
  1037.                            9: clear to the end of current line
  1038.                        10-11: set colors for output
  1039.                  12-15,18-19: set attributes for output
  1040.                        16-17: control cursor blink rate
  1041.                        20-21: change mode (not same as DOS, see ansihk.h)
  1042.                           22: outputs the current cursor location
  1043.   
  1044.                       A value must be passed for parm1 and parm2, even if
  1045.                       they are not going to be used.
  1046.   
  1047.                       The escape sequence ansistring can be outputted
  1048.                       with a simple printf().
  1049.   
  1050.                       Remember, ANSI.SYS, FANSI-CONSOLE, or some similar
  1051.                       ANSI control sequence program must be active for
  1052.                       these codes to take effect.
  1053.   
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.      TCHK 2.0                                               Page 16
  1064.  
  1065.   
  1066.   Return value        returns ansistring.
  1067.   
  1068.   Note                The color codes needed by ANSI functions are NOT
  1069.                       the same as the color codes used by DOS to set
  1070.                       attributes. Use the ANSI color #defines given in
  1071.                       ansihk.h.
  1072.   
  1073.   See also            ansiback(), ansifore()
  1074.   
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.      TCHK 2.0                                               Page 17
  1130.  
  1131.   
  1132.   Function             ansiback - convert DOS background code to ANSI
  1133.   
  1134.   Syntax              int ansiback(char code);
  1135.   
  1136.   Prototype in        ansihk.h
  1137.   
  1138.   Remarks             DOS and ANSI use different values for colors. This
  1139.                       function converts a DOS background color code to
  1140.                       the ANSI color code for the same color.
  1141.   
  1142.   Return value        returns the ANSI background color code
  1143.   
  1144.   See also            ansi_call(), ansifore()
  1145.   
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.      TCHK 2.0                                               Page 18
  1196.  
  1197.   
  1198.   Function             ansifore - convert DOS foreground code to ANSI
  1199.   
  1200.   Syntax              int ansifore(char code);
  1201.   
  1202.   Prototype in        ansihk.h
  1203.   
  1204.   Remarks             DOS and ANSI use different values for colors. This
  1205.                       function converts a DOS foreground color code to
  1206.                       the ANSI color code for the same color.
  1207.   
  1208.   Return value        returns the ANSI foreground color code
  1209.   
  1210.   See also            ansi_call(), ansiback()
  1211.   
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.      TCHK 2.0                                               Page 19
  1262.  
  1263.   
  1264.   Function             atrim - trims leading and trailing blanks
  1265.   
  1266.   Syntax              char *atrim(char *source);
  1267.   
  1268.   Prototype in        stringhk.h
  1269.   
  1270.   Remarks             remove leading and trailing blanks in a string. The
  1271.                       string passed to atrim (source) is modified.
  1272.   
  1273.   Return value        returns a pointer to source.
  1274.   
  1275.   Example             #include <stringhk.h>
  1276.                       #include <stdio.h>            /* for the printf */
  1277.   
  1278.                       main()
  1279.                       {
  1280.                            char msg[25] = "  Hello everyone   ";
  1281.                            printf("String [%s]\n",msg);
  1282.                            printf("atrim  [%s]\n",atrim(msg));
  1283.                       }
  1284.        
  1285.   Program output      String [  Hello everyone   ]
  1286.                       atrim  [Hello everyone]
  1287.   
  1288.   
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.      TCHK 2.0                                               Page 20
  1328.  
  1329.   
  1330.   Function             average - calculate the average of a set of reals
  1331.   
  1332.   Syntax              double average(int n, double element[]);
  1333.   
  1334.   Prototype in        mathhk.h
  1335.   
  1336.   Remarks             average calculates the average of a set of n
  1337.                       numbers of type double.
  1338.   
  1339.   Return value        returns the average of a set of n numbers.
  1340.   
  1341.   See also            stddev(), summation(), variance()
  1342.   
  1343.   Example             #include <mathhk.h>
  1344.   
  1345.                       main()
  1346.                       {
  1347.                            double num[] = { 2.3, 7.1, 6.05 };
  1348.   
  1349.                            printf("Average is %lf\n",average(3,num));
  1350.                       }
  1351.   
  1352.   Program output      Average is 5.15
  1353.   
  1354.   
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.      TCHK 2.0                                               Page 21
  1394.  
  1395.   
  1396.   Function             beep - generate a standard IBM PC beep
  1397.   
  1398.   Syntax              void beep(void);
  1399.   
  1400.   Prototype in        ibm.h
  1401.   
  1402.   Remarks             makes the speaker beep (just like the beep during
  1403.                       bootup).
  1404.   
  1405.   Return value        nothing.
  1406.   
  1407.   
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.      TCHK 2.0                                               Page 22
  1460.  
  1461.   
  1462.   Function             box - draw a box
  1463.   
  1464.   Syntax              int box(int left, int top, int right, int bottom,
  1465.                               char frame[]);
  1466.   
  1467.   Prototype in        video.h
  1468.   
  1469.   Remarks             draws a box via gotohv(), horiz_line(), putk() and
  1470.                       vert_line() (all use INTerrupts). Also, frame must
  1471.                       be have at least 9 elements (char frame[9]). The
  1472.                       box characters are frame[0] (top left) to frame[7]
  1473.                       (left wall), going clockwise. If frame[8] != '\0'
  1474.                       the box is filled with it.
  1475.   
  1476.   Return value        returns zero upon succesful completion, -1 if the
  1477.                       coordinates given are not large enough for a box.
  1478.   
  1479.   See also            global variables
  1480.                       boxwindow(), gotohv(), horiz_line(), putk(),
  1481.                       vert_line()
  1482.   
  1483.   Example             #include <video.h>
  1484.   
  1485.                       main()
  1486.                       {
  1487.                            char framebox[9] = "abcdefghi";
  1488.   
  1489.                            box(1,1,7,4,framebox);
  1490.                       }
  1491.   
  1492.   Program output      abbbbbc
  1493.                       hiiiiid
  1494.                       hiiiiid
  1495.                       gfffffe
  1496.   
  1497.   
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.      TCHK 2.0                                               Page 23
  1526.  
  1527.   
  1528.   Function             boxwindow - draw a 'window'
  1529.   
  1530.   Syntax              int boxwindow(int left, int top, int right, int
  1531.                                     bottom, char frame[], char *title,
  1532.                                     int titlejustify, char colborder,
  1533.                                     char coltitle, char colnorm, char
  1534.                                     *buffer);
  1535.   
  1536.   Prototype in        video.h
  1537.   
  1538.   Remarks             draws a 'window'-like box (similiar to box(), but
  1539.                       with a title) at the coordinates (left,top) to
  1540.                       (right,bottom). The characters in frame[] are used
  1541.                       to generate the frame, with frame[9] and frame[10] 
  1542.                       used as pre-/post-title separators. The title is
  1543.                       aligned as per titlejustify (LEFT, CENTER or RIGHT.
  1544.                       See HOWARD.H for more details). The frame uses the
  1545.                       colborder attribute, the title uses the coltitle
  1546.                       attribute and the inner portions of the box are
  1547.                       filled with spaces of colnorm color. The box is
  1548.                       stored in the memory allocated by buffer and
  1549.                       displayed with puttext().
  1550.   
  1551.                       The title is separated from the pre-/post-title
  1552.                       separators by a space.
  1553.   
  1554.                       Sufficient memory must be allocated for buffer to
  1555.                       contain the entire box, with attributes (see
  1556.                       scrbuff()).
  1557.   
  1558.                       Upon completion, buffer contains a copy of the
  1559.                       screen image of the box displayed (usable by
  1560.                       puttext()).
  1561.   
  1562.                       This routine is taken from an older version of the
  1563.                       popup...() and litebar...() creation functions.
  1564.                       This function does virtually no error checking and
  1565.                       does not currently support the NONE title
  1566.                       justification like the menu functions do.
  1567.   
  1568.   Return value        returns zero upon succesful completion, -1 if an
  1569.                       error occurs.
  1570.   
  1571.   See also            global variables
  1572.                       box(), horiz_line(), litebar...(), popup...(),
  1573.                       vert_line()
  1574.   
  1575.   Example             #include <video.h>
  1576.                       #include <howard.h>      /* for CENTER */
  1577.                       #include <color.h>       /* for colors */
  1578.   
  1579.                       main()
  1580.                       {
  1581.   
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.      TCHK 2.0                                               Page 24
  1592.  
  1593.                            char vidbuff[scrbuff(1,1,15,4)],
  1594.                                 framebox[] = "abcdefgh[]";
  1595.   
  1596.                            boxwindow(1,1,9,5,framebox,"Title",CENTER,
  1597.                                      CYAN,YELLOW,RED,vidbuff);
  1598.                       }
  1599.   
  1600.   Program output      abb[ Title ]bbc
  1601.                       h             d
  1602.                       h             d
  1603.                       gfffffffffffffe
  1604.   
  1605.   
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.      TCHK 2.0                                               Page 25
  1658.  
  1659.   
  1660.   Function             Cal... - family of Calendar date conversions
  1661.   
  1662.   Syntax              char *CaltoGreg(double cal);
  1663.                       char *CaltoGregEuro(double cal);
  1664.                       char *CaltoGregJap(double cal);
  1665.                       double CaltoJul(double cal);
  1666.                       double CaltoJulA(double cal);
  1667.                       double CaltoJulB(double cal);
  1668.                       double CaltoCalCent(double cal);
  1669.                       double CalCenttoCal(double cal);
  1670.   
  1671.   Prototype in        datehk.h
  1672.   
  1673.   Remarks             CaltoGreg      converts Calendar date to Gregorian
  1674.                                      (US) date
  1675.                       CaltoGregEuro  converts Calendar date to Gregorian
  1676.                                      (European) date
  1677.                       CaltoGregJap   converts Calendar date to Gregorian
  1678.                                      (Japan) date
  1679.                       CaltoJul       converts Calendar date to Julian
  1680.                                      (Type E) date
  1681.                       CaltoJulA      converts Calendar date to Julian
  1682.                                      (Type A) date
  1683.                       CaltoJulB      converts Calendar date to Julian
  1684.                                      (Type B) date
  1685.                       CaltoCalCent   converts Calendar date to Calendar
  1686.                                      date (w/century)
  1687.                       CalCenttoCal   converts Calendar date (w/century)
  1688.                                      to Calendar date
  1689.   
  1690.   Return value        CaltoGreg... return the appropriate Gregorian date
  1691.                       CaltoJul... return the appropriate Julian date
  1692.                       CaltoCalCent returns a Calendar date (w/century)
  1693.                       CalCentotCal returns a Calendar date
  1694.   
  1695.   See also            Appendix A
  1696.                       date_convert(), ddatetofull(), ddatetoshort(),
  1697.                       ddatetostr(), fulltoddate(), Greg...(), Jul...(),
  1698.                       monthexpand(), shorttoddate(), strtoddate()
  1699.   
  1700.   Example             see demodate.c
  1701.   
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.      TCHK 2.0                                               Page 26
  1724.  
  1725.   
  1726.   Function             CapsLock - set the Caps Lock key state
  1727.   
  1728.   Syntax              void InsLock(boolean on);
  1729.   
  1730.   Prototype in        ibm.h
  1731.   
  1732.   Remarks             sets the Caps Lock key state to the state selected
  1733.                       by the on parameter.
  1734.   
  1735.   Return value        nothing.
  1736.   
  1737.   See also            InsLock(), NumLock(), ScrollLock()
  1738.   
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.      TCHK 2.0                                               Page 27
  1790.  
  1791.   Function             changelitebar - set internal litebar menu 
  1792.                                            information
  1793.   
  1794.   Syntax              void changelitebar(struct litebar_header *lh,
  1795.                                          struct litebar_field *lf)
  1796.   
  1797.   Prototype in        menuhk.h
  1798.   
  1799.   Remarks             sets internal variables for a litebar menu
  1800.                       regarding the currently hilited item.
  1801.   
  1802.                       This function is used internally by several
  1803.                       litebar...() menu functions.
  1804.   
  1805.   Return value        nothing.
  1806.   
  1807.   Note                This function is for internal uses only.
  1808.   
  1809.   See also            menuhk.h
  1810.                       litebar_alloc(), litebar_free(), litebar_get(),
  1811.                       litehilite(), litemessage(), liteunhilite()
  1812.                       litebarerrno
  1813.   
  1814.   
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.      TCHK 2.0                                               Page 28
  1856.  
  1857.   
  1858.   Function             clear - clears a portion of the screen
  1859.   
  1860.   Syntax              void clear(int left, int top, int right,
  1861.                                  int bottom);
  1862.   
  1863.   Prototype in        video.h
  1864.   
  1865.   Remarks             clears a box of the screen via gotohv() and putk().
  1866.                       All screen coordinates are absolute.
  1867.   
  1868.   Return value        nothing.
  1869.   
  1870.   See also            cls(), gotohv(), putk()
  1871.   
  1872.   Example             #include <video.h>
  1873.   
  1874.                       main()
  1875.                       {
  1876.                            clear(0,0,79,3);    /* clear top 4 lines */
  1877.                       }
  1878.   
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.      TCHK 2.0                                               Page 29
  1922.  
  1923.   
  1924.   Function             clear_typeahead - clear typeahead buffer
  1925.   
  1926.   Syntax              int clear_typeahead(void);
  1927.   
  1928.   Prototype in        keyboard.h
  1929.   
  1930.   Remarks             clears the typeahead buffer and returns the number
  1931.                       of keystrokes cleared
  1932.   
  1933.   Return value        number of keystrokes emptied from the typeahead
  1934.                       buffer
  1935.   
  1936.   Example             #include <keyboard.h>
  1937.                       #include <stdio.h>
  1938.   
  1939.                       main()
  1940.                       {
  1941.                            printf("# keystrokes emptied = %d",
  1942.                                   clear_typeahead());
  1943.                       }
  1944.   
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.      TCHK 2.0                                               Page 30
  1988.  
  1989.   
  1990.   Function             cls - clear screen
  1991.   
  1992.   Syntax              #include <video.h>
  1993.                       cls();
  1994.   
  1995.   Prototype in        video.h
  1996.   
  1997.   Remarks             clears screen by Borland's clrscr(). I hated their
  1998.                       name for it, so I #defined cls().
  1999.   
  2000.   Return value        nothing.
  2001.   
  2002.   See also            clear()
  2003.   
  2004.   Example             #include <video.h>
  2005.   
  2006.                       main()
  2007.                       {
  2008.                            cls()
  2009.                       }
  2010.   
  2011.   
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.      TCHK 2.0                                               Page 31
  2054.  
  2055.   
  2056.   Function             color - make a single attribute
  2057.   
  2058.   Syntax              #include <video.h>
  2059.                       color(f,b)
  2060.   
  2061.   Prototype in        video.h
  2062.   
  2063.   Remarks             converts a color for a foreground and background
  2064.                       attribute in foreground format (0-15) to a single
  2065.                       byte.
  2066.   
  2067.                       This function is a macro.
  2068.   
  2069.   Return value        returns an attribute byte of foreground ORed with
  2070.                       the background shifted left 4 bits.
  2071.   
  2072.   
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.      TCHK 2.0                                               Page 32
  2120.  
  2121.   
  2122.   Function             cpu_id - identify the cpu
  2123.   
  2124.   Syntax              int cpu_id(void);
  2125.   
  2126.   Prototype in        chiphk.h
  2127.   
  2128.   Remarks             cpu_id does some opcode magic to identify the cpu.
  2129.                       Currently identified chips are the 8088/8086,
  2130.                       80286, 80386 and the NEV V20/V30.
  2131.   
  2132.   Return value        returns a value identifying the cpu. See chiphk.h
  2133.                       for further details.
  2134.   
  2135.   Note                Other (not 88/86, 286, 386 or V20/V30) chips will
  2136.                       not be identified correctly, and will probably be
  2137.                       interpreted as an NEC cpu.
  2138.   
  2139.   See also            machine_id(), ndp_id()
  2140.   
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.      TCHK 2.0                                               Page 33
  2186.  
  2187.   
  2188.   Function             cursor_blink - set speed of cursor blink
  2189.   
  2190.   Syntax              void cursor_blink(boolean fast);
  2191.   
  2192.   Prototype in        video.h
  2193.   
  2194.   Remarks             this function will make the cursor blink fast if
  2195.                       fast is TRUE, or slow if fast is FALSE.
  2196.   
  2197.   Return value        nothing.
  2198.   
  2199.   See also            cursor_flip(), cursor_off(), cursor_on(),
  2200.                       getcursor(), getcursor(), read_cursor(),
  2201.                       set_cursor(), setcursor()
  2202.   
  2203.   
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.      TCHK 2.0                                               Page 34
  2252.  
  2253.   
  2254.   Function             cursor_flip - toggle the cursor type
  2255.   
  2256.   Syntax              void cursor_flip(unsigned int curs1,
  2257.                                        unsigned int curs2);
  2258.   
  2259.   Prototype in        video.h
  2260.   
  2261.   Remarks             toggles the cursor scan lines to whichever set the
  2262.                       cursor is not currently set for.
  2263.   
  2264.   Return value        nothing.
  2265.   
  2266.   See also            cursor_blink(), cursor_off(), cursor_on(),
  2267.                       getcursor(), read_cursor(), set_cursor(),
  2268.                       setcursor()
  2269.   
  2270.   Example             #include <video.h>
  2271.   
  2272.                       main()
  2273.                       {
  2274.                            cursor_flip(CURSOR_UNDERBAR,CURSOR_HALFBLOCK);
  2275.                       }
  2276.   
  2277.   
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.      TCHK 2.0                                               Page 35
  2318.  
  2319.   
  2320.   Function             cursor_off - turn the cursor off
  2321.   
  2322.   Syntax              void cursor_off(void);
  2323.   
  2324.   Prototype in        video.h
  2325.   
  2326.   Remarks             makes the cursor invisible.
  2327.   
  2328.   Return value        nothing.
  2329.   
  2330.   See also            cursor_blink(), cursor_flip(), cursor_on(),
  2331.                       getcursor(), read_cursor(), set_cursor(),
  2332.                       setcursor()
  2333.   
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.      TCHK 2.0                                               Page 36
  2384.  
  2385.   
  2386.   Function             cursor_on - turn the cursor on
  2387.   
  2388.   Syntax              void cursor_on(void);
  2389.   
  2390.   Prototype in        video.h
  2391.   
  2392.   Remarks             makes the cursor visible.
  2393.   
  2394.   Return value        nothing.
  2395.   
  2396.   See also            cursor_blink(), cursor_flip(), cursor_off(),
  2397.                       getcursor(), read_cursor(), set_cursor(),
  2398.                       setcursor()
  2399.   
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.      TCHK 2.0                                               Page 37
  2450.  
  2451.   
  2452.   Function             date_convert - convert date formats
  2453.   
  2454.   Syntax              boolean date_convert(void *source, void *dest,
  2455.                                            int stype, int dtype);
  2456.   
  2457.   Prototype in        dateadv.h
  2458.   
  2459.   Remarks             date_convert will convert a date from virtually any
  2460.                       date format to any other. The parameters *source
  2461.                       and *dest must be pointers pointing to a piece of
  2462.                       memory allocated as the proper data type. stype and
  2463.                       dtype determine the format of source and dest.
  2464.   
  2465.                       Due to the great number of formats supported, a
  2466.                       chart of valid date formats is provided in Appendix
  2467.                       B.
  2468.   
  2469.                       Limited error checking is done on passed data. If
  2470.                       an invalid date format is passed, unpredictable
  2471.                       results will occur.
  2472.   
  2473.   Return value        returns TRUE is the conversion was successful and
  2474.                       FALSE if the date could not be converted.
  2475.   
  2476.   Note                This function does NO function calls except for
  2477.                       isleapyear(). I've tried to optimize this function
  2478.                       as much as possible for speed, not size. If you
  2479.                       only need to convert between, say, Calendar and
  2480.                       Julian dates, you may be better off using the
  2481.                       functions listed in datehk.h.
  2482.   
  2483.   See also            Appendix A, B
  2484.                       Cal...(), ddatetofull(), ddatetoshort(),
  2485.                       ddatetostr(), fulltoddate(), Greg...(), Jul...(),
  2486.                       monthexpand(), shorttoddate(), strtoddate()
  2487.   
  2488.   Example             see demoadv.c
  2489.   
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.      TCHK 2.0                                               Page 38
  2516.  
  2517.   
  2518.   Function             dayofweek - find the day of the week
  2519.   
  2520.   Syntax              int dayofweek(double jul);
  2521.   
  2522.   Prototype in        datehk.h
  2523.   
  2524.   Remarks             finds the day of the week for a given Julian
  2525.                       (Type E) date
  2526.   
  2527.   Return value        returns 0-6 (Sun...Sat)
  2528.   
  2529.   See also            Appendix A
  2530.                       datehk.h
  2531.   
  2532.   Example             see demodate.c
  2533.   
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.      TCHK 2.0                                               Page 39
  2582.  
  2583.   
  2584.   Function             dayofyear - calculate the day of the year
  2585.   
  2586.   Syntax              int dayofyear(struct ddate *d);
  2587.   
  2588.   Prototype in        datehk.h
  2589.   
  2590.   Remarks             dayofyear calculate the day of the year given a
  2591.                       date. The day of the year will range from 1
  2592.                       (January 1) to 365 (Dec 31, no leap year) or 366
  2593.                       (Dec 31, leap year.)
  2594.   
  2595.                       dayofyear does no error checking on passed
  2596.                       parameters.
  2597.   
  2598.   Return value        returns a number from 1 to 365 (no leap year) or
  2599.                       366 (leap year.)
  2600.   
  2601.   See also            dayofweek(), daysleft(), diffddate()
  2602.   
  2603.   Example             #include <datehk.h>
  2604.   
  2605.                       main()
  2606.                       {
  2607.                            struct ddate today;
  2608.   
  2609.                            /* set today to Feb 3, 1987 */
  2610.                            printf("%d/%d = day %d\n", today.dmon,
  2611.                                 today.dday, dayofyear(&today));
  2612.                       }
  2613.   
  2614.   Program output      2/3 = day 34
  2615.   
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.      TCHK 2.0                                               Page 40
  2648.  
  2649.   
  2650.   Function             daysleft - calculate the days left in the year
  2651.   
  2652.   Syntax              int daysleft(struct ddate *d);
  2653.   
  2654.   Prototype in        datehk.h
  2655.   
  2656.   Remarks             daysleft calculates how many more days are left in
  2657.                       the year. The days left will range from 0 (Dec 31)
  2658.                       to 364 (Jan 1, no leap year) or 365 (Jan 1, leap
  2659.                       year.)
  2660.   
  2661.                       daysleft does no error checking on passed
  2662.                       parameters.
  2663.   
  2664.   Return value        returns a number from 0 to 364 (no leap year) or
  2665.                       365 (leap year.)
  2666.   
  2667.   See also            dayofyear(), diffddate()
  2668.   
  2669.   Example             #include <datehk.h>
  2670.   
  2671.                       main()
  2672.                       {
  2673.                            struct ddate today;
  2674.   
  2675.                            /* set today to Nov 3, 1987 */
  2676.                            printf("%d/%d = %d days left\n", today.dmon,
  2677.                                 today.dday, daysleft(&today));
  2678.                       }
  2679.   
  2680.   Program output      11/3 = 58 days left
  2681.   
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.      TCHK 2.0                                               Page 41
  2714.  
  2715.   
  2716.   Function             ddatetofull - convert a date to full string
  2717.   
  2718.   Syntax              char *ddatetofull(struct ddate *source); 
  2719.   
  2720.   Prototype in        datehk.h
  2721.   
  2722.   Remarks             ddatetofull converts a date from the structure
  2723.                       format ddate to a string in the form
  2724.                            Month dd, Year  where
  2725.   
  2726.                            Month = the name of the month ("November")
  2727.                            dd    = the day (5, 12, etc.)
  2728.                            Year  = the year + 1900
  2729.   
  2730.   Return value        returns a pointer to the storage location
  2731.                       containing the date in string format, or NULL if
  2732.                       space could not be allocated.
  2733.   
  2734.   See also            Cal...(), date_convert(), ddatetoshort(),
  2735.                       ddatetostr(), fulltoddate(), Greg...(), Jul...(),
  2736.                       monthexpand(), shorttoddate(), strtoddate()
  2737.   
  2738.   Example             #include <datehk.h>
  2739.   
  2740.                       main()
  2741.                       {
  2742.                            struct ddate today;
  2743.                            char *strtoday;
  2744.   
  2745.                       /* assign some value to today */
  2746.                            strtoday = ddatetofull(&today);
  2747.                            printf("today is %d-%d-%d\n", today.dmon,
  2748.                                   today.dday, today.dyear);
  2749.                            printf("or %s\n", (strtoday==NULL) ?
  2750.                                   "no memory" : strtoday);
  2751.                       }
  2752.   
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.      TCHK 2.0                                               Page 42
  2780.  
  2781.   
  2782.   Function             ddatetoshort - convert a date to short string
  2783.   
  2784.   Syntax              char *ddatetoshort(struct ddate *source); 
  2785.   
  2786.   Prototype in        datehk.h
  2787.   
  2788.   Remarks             ddatetoshort converts a date from the structure
  2789.                       format ddate to a string in the form
  2790.                            Mon dd, Year  where
  2791.   
  2792.                            Mon  = the abbreviation of the month ("Nov")
  2793.                            dd   = the day (5, 12, etc.)
  2794.                            Year = the year + 1900
  2795.   
  2796.   Return value        returns a pointer to the storage location
  2797.                       containing the date in string format, or NULL if
  2798.                       space could not be allocated.
  2799.   
  2800.   See also            Cal...(), date_convert(), ddatetofull(),
  2801.                       ddatetostr(), fulltoddate(), Greg...(), Jul...(),
  2802.                       monthexpand(), shorttoddate(), strtoddate()
  2803.   
  2804.   Example             #include <datehk.h>
  2805.   
  2806.                       main()
  2807.                       {
  2808.                            struct ddate today;
  2809.                            char *strtoday;
  2810.   
  2811.                       /* assign some value to today */
  2812.                            strtoday = ddatetoshort(&today);
  2813.                            printf("today is %d-%d-%d\n", today.dmon,
  2814.                                   today.dday, today.dyear);
  2815.                            printf("or %s\n", (strtoday==NULL) ?
  2816.                                   "no memory" : strtoday);
  2817.                       }
  2818.   
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.      TCHK 2.0                                               Page 43
  2846.  
  2847.   
  2848.   Function             ddatetostr - convert a date to abbrev. string
  2849.   
  2850.   Syntax              char *ddatetostr(struct ddate *source);
  2851.   
  2852.   Prototype in        datehk.h
  2853.   
  2854.   Remarks             ddatetostr converts a date from the structure
  2855.                       format ddate to a string in the form mm-dd-y..y
  2856.                       where the month and day are always 2 digits long (a
  2857.                       0 is prefixed to single digit months and days) and
  2858.                       year is not altered.
  2859.   
  2860.   Return value        returns a pointer to the storage location
  2861.                       containing the date in string format, or NULL if
  2862.                       space could not be allocated.
  2863.   
  2864.   See also            Cal...(), date_convert(), ddatetofull(),
  2865.                       ddatetoshort(), ddatetostr(), fulltoddate(),
  2866.                       Greg...(), Jul...(), monthexpand(), shorttoddate(),
  2867.                       strtoddate()
  2868.   
  2869.   Example             #include <datehk.h>
  2870.   
  2871.                       main()
  2872.                       {
  2873.                            struct ddate today;
  2874.                            char *strtoday;
  2875.   
  2876.                       /* assign some value to today */
  2877.                            strtoday = ddatetostr(&today);
  2878.                            printf("today is %d-%d-%d\n", today.dmon,
  2879.                                 today.dday, today.dyear);
  2880.                            printf("or %s\n", (strtoday==NULL) ?
  2881.                                 "no memory" : strtoday);
  2882.                       }
  2883.   
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.      TCHK 2.0                                               Page 44
  2912.  
  2913.   
  2914.   Function             depreciation - calculate depreciation for a
  2915.                                        period
  2916.   
  2917.   Syntax              double depreciation(double cost, double salvage,
  2918.                                           int life, int period, int
  2919.                                           dtype);
  2920.   
  2921.   Prototype in        finance.h
  2922.   
  2923.   Remarks             given the cost, salvage value and life of an item,
  2924.                       depreciation will calculate the amount of
  2925.                       deprecitation for the given period according to the
  2926.                       depreciation method specified by dtype. The cost
  2927.                       and salvage can be given in any unit (dollars,
  2928.                       thousands of dollars, etc.) but the life should be
  2929.                       given in depreciable periods (if you depreciate an
  2930.                       item every quarter, and the item has a life of 2
  2931.                       years, then life should be 8).
  2932.   
  2933.                       The cost and salvage values should be in the same
  2934.                       units. The life and period should be given in the
  2935.                       same units.
  2936.   
  2937.                       Types of depreciation supported by the variable
  2938.                       dtype are:
  2939.   
  2940.                            1 -  Straight line depreciation
  2941.                            2 -  Sum of the years digits depreciation
  2942.                            3 -  Double declining balance depreciation
  2943.   
  2944.                       Any other value for dtype will produce
  2945.                       unpredictable results.
  2946.   
  2947.                       No error checking is performed.
  2948.   
  2949.                       This is a generic function to calculate the
  2950.                       depreciation given all necessary information. Any
  2951.                       unnecessary information is ignored (i.e. straight
  2952.                       line depreciation does not need a period.)
  2953.   
  2954.   Return value        returns the amount of depreciation for the given
  2955.                       period in the same units as the cost, as per the
  2956.                       depreciation method specified by dtype.
  2957.   
  2958.   See also            accum_dep(), double_decline_bal_dep(),
  2959.                       straight_line_dep(), sum_year_digits_dep()
  2960.   
  2961.   Example             see demonum.c
  2962.   
  2963.   
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.      TCHK 2.0                                               Page 45
  2978.  
  2979.   
  2980.   Function             DESQcommonmem - returns measure of common memory
  2981.                                         available
  2982.   
  2983.   Syntax              void DESQcommonmem(struct DESQmemory *dm);
  2984.   
  2985.   Prototype in        multihk.h
  2986.   
  2987.   Remarks             determines the amount of available common memory
  2988.                       under DESQview. No error checking is performed.
  2989.   
  2990.                       DESQcommonmem returns the amount of available
  2991.                       common memory in dm. The values returned are in
  2992.                       bytes.
  2993.   
  2994.   Return value        nothing.
  2995.   
  2996.   See also            DESQconvenmem(), DESQdispchar(), DESQexit(),
  2997.                       DESQexpandedmem(), DESQfreeCPU(),
  2998.                       DESQInternalStack(), DESQMakeTone(),
  2999.                       DESQProgramStack(), DESQversion()
  3000.   
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.      TCHK 2.0                                               Page 46
  3044.  
  3045.   
  3046.   Function             DESQconvenmem - returns measure of conventional
  3047.                                         memory available
  3048.   
  3049.   Syntax              void DESQconvenmem(struct DESQmemory *dm);
  3050.   
  3051.   Prototype in        multihk.h
  3052.   
  3053.   Remarks             determines the amount of available conventional
  3054.                       memory under DESQview. No error checking is
  3055.                       performed.
  3056.   
  3057.                       DESQconvenmem returns the amount of available
  3058.                       conventional memory in dm. The values returned are
  3059.                       in Kbytes.
  3060.   
  3061.   Return value        nothing.
  3062.   
  3063.   See also            DESQcommonmem(), DESQdispchar(), DESQexit(),
  3064.                       DESQexpandedmem(), DESQfreeCPU(),
  3065.                       DESQInternalStack(), DESQMakeTone(),
  3066.                       DESQProgramStack(), DESQversion()
  3067.   
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.      TCHK 2.0                                               Page 47
  3110.  
  3111.   
  3112.   Function             DESQdispchar - displays a char on the status line
  3113.   
  3114.   Syntax              char DESQdispchar(char c);
  3115.   
  3116.   Prototype in        multihk.h
  3117.   
  3118.   Remarks             displays a character on the status line. No error
  3119.                       checking is performed.
  3120.   
  3121.   Return value        DESQdispchar returns the .
  3122.   
  3123.   See also            DESQcommonmem(), DESQconvenmem(), DESQexit(),
  3124.                       DESQexpandedmem(), DESQfreeCPU(),
  3125.                       DESQInternalStack(), DESQMakeTone(),
  3126.                       DESQProgramStack(), DESQversion()
  3127.   
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.      TCHK 2.0                                               Page 48
  3176.  
  3177.   
  3178.   Function             DESQexit - exit program in DESQview
  3179.   
  3180.   Syntax              void DESQexit(void);
  3181.   
  3182.   Prototype in        multihk.h
  3183.   
  3184.   Remarks             exits the current program under DESQview (and
  3185.                       possibly Topview). No error checking is performed.
  3186.   
  3187.   Return value        nothing.
  3188.   
  3189.   See also            DESQcommonmem(), DESQconvenmem(), DESQdispchar(),
  3190.                       DESQexpandedmem(), DESQfreeCPU(),
  3191.                       DESQInternalStack(), DESQMakeTone(),
  3192.                       DESQProgramStack(), DESQversion()
  3193.   
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.      TCHK 2.0                                               Page 49
  3242.  
  3243.   
  3244.   Function             DESQexpandedmem - returns measure of expanded
  3245.                                           memory available
  3246.   
  3247.   Syntax              void DESQexpanded(struct DESQmemory *dm);
  3248.   
  3249.   Prototype in        multihk.h
  3250.   
  3251.   Remarks             determines the amount of available expanded memory
  3252.                       under DESQview. No error checking is performed.
  3253.   
  3254.                       DESQexpandedmed returns the amount of available
  3255.                       expanded memory in dm. The values returned are in
  3256.                       Kbytes.
  3257.   
  3258.   
  3259.   Return value        nothing.
  3260.   
  3261.   See also            DESQcommonmem(), DESQconvenmem(), DESQdispchar(),
  3262.                       DESQexit(), DESQfreeCPU(), DESQInternalStack(),
  3263.                       DESQMakeTone(), DESQProgramStack(), DESQversion()
  3264.   
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.      TCHK 2.0                                               Page 50
  3308.  
  3309.   
  3310.   Function             DESQfreeCPU - give up CPU time
  3311.   
  3312.   Syntax              void DESQfreeCPU(void);
  3313.   
  3314.   Prototype in        multihk.h
  3315.   
  3316.   Remarks             this function will free the remaining CPU cycles
  3317.                       under DESQview, Topview and Taskview. I have tested
  3318.                       this function only under DESQview, where I believe
  3319.                       it frees the reamining ticks in the program's turn.
  3320.                       If your program will just sit idle and chew up CPU
  3321.                       time, calling this function frees whatever remain
  3322.                       of its cpu share.
  3323.   
  3324.                       No error checking is performed.
  3325.   
  3326.   Return value        nothing.
  3327.   
  3328.   See also            DESQcommonmem(), DESQconvenmem(), DESQdispchar(),
  3329.                       DESQexit(), DESQexpandedmem(), DESQInternalStack(),
  3330.                       DESQMakeTone(), DESQProgramStack(), DESQversion()
  3331.   
  3332.   Example             ...  /* code fragment */
  3333.                       while (bioskey(1) == 0)  /* wait for keypress */
  3334.                            DESQfreeCPU();      /* w/o wasting cpu time */
  3335.                       ...
  3336.   
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.      TCHK 2.0                                               Page 51
  3374.  
  3375.   
  3376.   Function             DESQInternalStack - switch to DESQview's internal
  3377.                                             stack
  3378.   
  3379.   Syntax              void DESQInternalStack(void);
  3380.   
  3381.   Prototype in        multihk.h
  3382.   
  3383.   Remarks             switches the stack used to DESQview's internal
  3384.                       stack. No error checking is performed.
  3385.   
  3386.   Return value        nothing.
  3387.   
  3388.   See also            DESQcommonmem(), DESQconvenmem(), DESQdispchar(),
  3389.                       DESQexit(), DESQexpandedmem(), DESQfreeCPU(),
  3390.                       DESQMakeTone(), DESQProgramStack(), DESQversion()
  3391.   
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.      TCHK 2.0                                               Page 52
  3440.  
  3441.   
  3442.   Function             DESQMakeTone - makes a tone under DESQview
  3443.   
  3444.   Syntax              void DESQMakeTone(int frequency, int duration);
  3445.   
  3446.   Prototype in        multihk.h
  3447.   
  3448.   Remarks             DESQMakeTone will generate a tone of frequency in
  3449.                       Hz for duration clock ticks (approximately 18.2
  3450.                       ticks/sec). No error checking is performed.
  3451.   
  3452.   Return value        nothing.
  3453.   
  3454.   See also            DESQcommonmem(), DESQconvenmem(), DESQdispchar(),
  3455.                       DESQexit(), DESQexpandedmem(), DESQfreeCPU(),
  3456.                       DESQInternalStack(), DESQProgramStack(),
  3457.                       DESQversion()
  3458.   
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.      TCHK 2.0                                               Page 53
  3506.  
  3507.   
  3508.   Function             DESQProgramStack -  switch back to program's
  3509.                                             stack
  3510.   
  3511.   Syntax              void DESQProgramStack(void);
  3512.   
  3513.   Prototype in        multihk.h
  3514.   
  3515.   Remarks             switches the stack from DESQview's internal stack
  3516.                       back to the program's stack. No error checking is
  3517.                       performed.
  3518.   
  3519.   Return value        nothing.
  3520.   
  3521.   See also            DESQcommonmem(), DESQconvenmem(), DESQdispchar(),
  3522.                       DESQexit(), DESQexpandedmem(), DESQfreeCPU(),
  3523.                       DESQInternalStack(), DESQMakeTone(), DESQversion()
  3524.   
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.      TCHK 2.0                                               Page 54
  3572.  
  3573.   
  3574.   Function             DESQversion - DESQview version
  3575.   
  3576.   Syntax              int DESQversion(void);
  3577.   
  3578.   Prototype in        multihk.h
  3579.   
  3580.   Remarks             determines if DESQview is running and gets the
  3581.                       version number
  3582.   
  3583.   Return value        returns zero if DESQview is not running, otherwise
  3584.                       returns the version number with the major version
  3585.                       number in the high order byte and the minor version
  3586.                       number in the low order byte.
  3587.   
  3588.   Note                Now that I've gotten this function to work properly
  3589.                       for DESQview, I do not guarrantee it's accuracy
  3590.                       with regards to Topview or Taskview. If someone out
  3591.                       there with access to either could test it out and
  3592.                       let me know I'd appreciate it.
  3593.   
  3594.   See also            DESQcommonmem(), DESQconvenmem(), DESQdispchar(),
  3595.                       DESQexit(), DESQexpandedmem(), DESQfreeCPU(),
  3596.                       DESQInternalStack(), DESQMakeTone(),
  3597.                       DESQProgramStack()
  3598.   
  3599.   Example             #include <multihk.h>
  3600.   
  3601.                       main()
  3602.                       {
  3603.                            unsigned int ver;
  3604.   
  3605.                            if ((ver = DESQversion()) == 0)
  3606.                                 printf("DESQview is not running\n");
  3607.                            else
  3608.                                 printf("DESQview version %d.%2d\n",
  3609.                                      (ver&0xFF00)>>8, ver&0x00FF);
  3610.                       }
  3611.   
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.      TCHK 2.0                                               Page 55
  3638.  
  3639.   
  3640.   Function             diffddate - calculate the difference in 2 dates
  3641.   
  3642.   Syntax              long int diffddate(struct ddate *start,
  3643.                                           struct ddate *fini);
  3644.   
  3645.   Prototype in        datehk.h
  3646.   
  3647.   Remarks             diffdate calculates the difference in days between
  3648.                       start and fini (fini - start).
  3649.   
  3650.                       diffdate does not perform any error checking on the
  3651.                       passed parameters.
  3652.   
  3653.   Return value        returns the number of days from start to fini.
  3654.   
  3655.   See also            dayofyear(), daysleft(), diffddate()
  3656.   
  3657.   Example             #include <datehk.h>
  3658.   
  3659.                       main()
  3660.                       {
  3661.                            struct ddate begin, end;
  3662.                            long int days;
  3663.   
  3664.                            /* set begin to Jan 1, 1981 */
  3665.                            /* set end to Feb 5, 1982 */
  3666.                            days = diffdate(&begin,&end);
  3667.                            printf("Feb 5, 1982 - Jan 1, 1981 =
  3668.                                 %ld\n",days);
  3669.                       }
  3670.   
  3671.   Program output      Feb 5, 1982 - Jan 1, 1981 = 400
  3672.   
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.      TCHK 2.0                                               Page 56
  3704.  
  3705.   
  3706.   Function             diskchanged - has the disk has been changed
  3707.   
  3708.   Syntax              boolean diskchanged(int drive);
  3709.   
  3710.   Prototype in        ibm.h
  3711.   
  3712.   Remarks             diskchanged determines if the disk has been changed
  3713.                       since the last access via INT 0x13, Function 0x16.
  3714.                       The drive parameter corresponds to the drive
  3715.                       letter, 0 = A:, 1 = B:, etc.
  3716.   
  3717.   Return value        returns TRUE if the disk has been changd since the
  3718.                       last access and FALSE otherwise.
  3719.   
  3720.   Note                This function valid only on AT, XT2, XT286,
  3721.                       Convertible and PS/2.
  3722.   
  3723.   See also            disktype()
  3724.   
  3725.   
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.      TCHK 2.0                                               Page 57
  3770.  
  3771.   
  3772.   Function             disktype - identify disk type
  3773.   
  3774.   Syntax              byte disktype(byte drive);
  3775.   
  3776.   Prototype in        ibm.h
  3777.   
  3778.   Remarks             disktype will determine the type of disk in the
  3779.                       disk drive being tested. drive specifies the drive
  3780.                       to check. Set drive to zero to specify the default
  3781.                       drive, one is A:, two is B:, etc.
  3782.   
  3783.   Return value        returns the drive id byte. See ibm.h for more
  3784.                       details.
  3785.   
  3786.   See also            diskchanged()
  3787.   
  3788.   Example             see demodisk.c
  3789.   
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.      TCHK 2.0                                               Page 58
  3836.  
  3837.   
  3838.   Function             dosday - extract day from file date stamp
  3839.   
  3840.   Syntax              #include <doshk.h>
  3841.                       (unsigned) dosday(d)
  3842.   
  3843.   Prototype in        doshk.h
  3844.   
  3845.   Remarks             extracts the day from a DOS file date stamp. Refer
  3846.                       to a DOS reference book (Advanced MS-DOS by Ray
  3847.                       Duncan recommended) for further details.
  3848.   
  3849.                       This function is a macro.
  3850.   
  3851.   Return value        returns the day of a DOS file date stamp.
  3852.   
  3853.   See also            doshour(), dosmonth(), dosmin(), dossec(),
  3854.                       dosyear(), todosdate(), todostime()
  3855.   
  3856.   
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.      TCHK 2.0                                               Page 59
  3902.  
  3903.   
  3904.   Function             doshour - extract hour from file time stamp
  3905.   
  3906.   Syntax              #include <doshk.h>
  3907.                       (unsigned) doshour(h)
  3908.   
  3909.   Prototype in        doshk.h
  3910.   
  3911.   Remarks             extracts the hour from a DOS file time stamp. Refer
  3912.                       to a DOS reference book (Advanced MS-DOS by Ray
  3913.                       Duncan recommended) for further details.
  3914.   
  3915.                       This function is a macro.
  3916.   
  3917.   Return value        returns the hour of a DOS file time stamp.
  3918.   
  3919.   See also            dosday(), dosmonth(), dosmin(), dossec(),
  3920.                       dosyear(), todosdate(), todostime()
  3921.   
  3922.   
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.      TCHK 2.0                                               Page 60
  3968.  
  3969.   
  3970.   Function             dosmonth - extract hour from file date stamp
  3971.   
  3972.   Syntax              #include <doshk.h>
  3973.                       (unsigned) dosmonth(m)
  3974.   
  3975.   Prototype in        doshk.h
  3976.   
  3977.   Remarks             extracts the month from a DOS file date stamp.
  3978.                       Refer to a DOS reference book (Advanced MS-DOS by
  3979.                       Ray Duncan recommended) for further details.
  3980.   
  3981.                       This function is a macro.
  3982.   
  3983.   Return value        returns the hour of a DOS file date stamp.
  3984.   
  3985.   See also            dosday(), doshour(), dosmin(), dossec(), dosyear(),
  3986.                       todosdate(), todostime()
  3987.   
  3988.   
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.      TCHK 2.0                                               Page 61
  4034.  
  4035.   
  4036.   Function             dosmin - extract minutes from file time stamp
  4037.   
  4038.   Syntax              #include <doshk.h>
  4039.                       (unsigned) dosmin(m)
  4040.   
  4041.   Prototype in        doshk.h
  4042.   
  4043.   Remarks             extracts the minutes from a DOS file time stamp.
  4044.                       Refer to a DOS reference book (Advanced MS-DOS by
  4045.                       Ray Duncan recommended) for further details.
  4046.   
  4047.                       This function is a macro.
  4048.   
  4049.   Return value        returns the minutes of a DOS file time stamp.
  4050.   
  4051.   See also            dosday(), doshour(), dosmonth(), dossec(),
  4052.                       dosyear(), todosdate(), todostime()
  4053.   
  4054.   
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.      TCHK 2.0                                               Page 62
  4100.  
  4101.   
  4102.   Function             dossec - extract seconds from file time stamp
  4103.   
  4104.   Syntax              #include <doshk.h>
  4105.                       (unsigned) dossec(s)
  4106.   
  4107.   Prototype in        doshk.h
  4108.   
  4109.   Remarks             extracts the seconds from a DOS file time stamp.
  4110.                       Refer to a DOS reference book (Advanced MS-DOS by
  4111.                       Ray Duncan recommended) for further details.
  4112.   
  4113.                       This function is a macro.
  4114.   
  4115.   Return value        returns the hour of a DOS file time stamp.
  4116.   
  4117.   See also            dosday(), doshour(), dosmonth(), dosmin(),
  4118.                       dosyear(), todosdate(), todostime()
  4119.   
  4120.   
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.      TCHK 2.0                                               Page 63
  4166.  
  4167.   
  4168.   Function             dosyear - extract year from file date stamp
  4169.   
  4170.   Syntax              #include <doshk.h>
  4171.                       (unsigned) dosyear(y)
  4172.   
  4173.   Prototype in        doshk.h
  4174.   
  4175.   Remarks             extracts the year from a DOS file date stamp. Refer
  4176.                       to a DOS reference book (Advanced MS-DOS by Ray
  4177.                       Duncan recommended) for further details.
  4178.   
  4179.                       This function is a macro.
  4180.   
  4181.   Return value        returns the year of a DOS file date stamp.
  4182.   
  4183.   See also            dosday(), doshour(), dosmonth(), dosmin(),
  4184.                       dossec(), todosdate(), todostime()
  4185.   
  4186.   
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.      TCHK 2.0                                               Page 64
  4232.  
  4233.   
  4234.   Function             double_decline_bal_dep - calculate double
  4235.                                                  declining balance
  4236.                                                  depreciation
  4237.   
  4238.   Syntax              double double_decline_bal_dep(double cost, int
  4239.                                                     life, int period);
  4240.   
  4241.   Prototype in        finance.h
  4242.   
  4243.   Remarks             given the cost and life of an item,
  4244.                       double_decline_bal_dep will calculate the amount of
  4245.                       deprecitation for the given period according to the
  4246.                       double declining balance depreciation method. The
  4247.                       cost can be given in any unit (dollars, thousands
  4248.                       of dollars, etc.) but the life should be given in
  4249.                       depreciable periods (if you depreciate an item
  4250.                       every quarter, and the item has a life of 2 years,
  4251.                       then life should be 8).
  4252.   
  4253.                       The life and period should be given in the same
  4254.                       units.
  4255.   
  4256.                       No error checking is performed.
  4257.   
  4258.   Return value        returns the amount of depreciation for the given
  4259.                       period in the same units as the cost, as per the
  4260.                       double declining balance depreciation method.
  4261.   
  4262.   Note                The macro DDB(c,l,p) is defined in finance.h for
  4263.                       ease of use.
  4264.   
  4265.   See also            accum_dep(), depreciation(), straight_line_dep(),
  4266.                       sum_year_digits_dep()
  4267.   
  4268.   Example             see demonum.c
  4269.   
  4270.   
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.      TCHK 2.0                                               Page 65
  4298.  
  4299.   
  4300.   Function             DoubleDOSfreeCPU - give up CPU time under
  4301.                                            Double DOS
  4302.   
  4303.   Syntax              void DoubleDOSfreeCPU(byte slices);
  4304.   
  4305.   Prototype in        multihk.h
  4306.   
  4307.   Remarks             DoubleDOSfreeCPU frees up CPU time from the current
  4308.                       program. The amount of time freed up is found by
  4309.                       slices * 55ms.
  4310.   
  4311.   Return value        nothing.
  4312.   
  4313.   See also            DoubleDOSGetVirtual(), DoubleDOSTaskSwitch(),
  4314.                       isDoubleDOS()
  4315.   
  4316.   Example             #include <multihk.h>
  4317.   
  4318.                       main()
  4319.                       {
  4320.                            DoubleDOSfreeCPU(1000);  /* frees 55 secs */
  4321.                       }
  4322.   
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.      TCHK 2.0                                               Page 66
  4364.  
  4365.   
  4366.   Function             DoubleDOSGetVirtual - get DoubleDOS virtual
  4367.                                               screen address
  4368.   
  4369.   Syntax              unsigned int DoubleDOSGetVirtual(void);
  4370.   
  4371.   Prototype in        multihk.h
  4372.   
  4373.   Remarks             determines and returns the segment of the virtual
  4374.                       screen address for the current task.
  4375.   
  4376.   Return value        DoubleDOSGetVirtual returns the segment of the
  4377.                       virtual screen address
  4378.   
  4379.   See also            DoubleDOSfreeCPU(), DoubleDOSTaskSwitch(),
  4380.                       isDoubleDOS()
  4381.   
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.      TCHK 2.0                                               Page 67
  4430.  
  4431.   
  4432.   Function             DoubleDOSTaskSwitch - set Double DOS task
  4433.                                               switching on/off
  4434.   
  4435.   Syntax              void DoubleDOSTaskSwitch(boolean on);
  4436.   
  4437.   Prototype in        multihk.h
  4438.   
  4439.   Remarks             sets Double DOS task switching on or off.
  4440.   
  4441.   Return value        nothing.
  4442.   
  4443.   See also            DoubleDOSfreeCPU(), DoubleDOSGetVirtual(),
  4444.                       isDoubleDOS()
  4445.   
  4446.   Example             #include <multihk.h>
  4447.   
  4448.                       #define ENABLE      TRUE
  4449.   
  4450.                       main()
  4451.                       {
  4452.                            DoubleDOSTaskSwitch(ENABLE);
  4453.                       }
  4454.   
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.      TCHK 2.0                                               Page 68
  4496.  
  4497.   
  4498.   Function             EMMversion - version of Expanded Memory Manager
  4499.   
  4500.   Syntax              boolean EMMversion(byte *version);
  4501.   
  4502.   Prototype in        ibm.h
  4503.   
  4504.   Remarks             determines the version of the Expanded Memory
  4505.                       Manager. No memory is allocated.
  4506.   
  4507.   Return value        returns TRUE if successful (and *version is the
  4508.                       version id,) FALSE if an error occurred (and
  4509.                       *version is the error code.)
  4510.   
  4511.   Note                this function is available under EMM 3.2 specs.
  4512.   
  4513.   See also            ibm.h
  4514.                       getEMSstatus(), isEMSavail(), ESMinfo(),
  4515.                       EMSpages(), EMSwarmbootprep()
  4516.   
  4517.   Example             #include <ibm.h>
  4518.   
  4519.                       main()
  4520.                       {
  4521.                            byte ver;
  4522.   
  4523.                            if (isEMSavail())
  4524.                                 if (EMMversion(&ver))    /* success */
  4525.                                      printf("EMM version id %X\n",ver);
  4526.                                 else                /* error */
  4527.                                      printf("EMM error code %X\n",ver);
  4528.                       }
  4529.   
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.      TCHK 2.0                                               Page 69
  4562.  
  4563.   
  4564.   Function             EMSinfo - determines EMM version and EMS pages
  4565.   
  4566.   Syntax              boolean EMSinfo(struct EMSrecord *ems);
  4567.   
  4568.   Prototype in        ibm.h
  4569.   
  4570.   Remarks             if EMS is available, EMSinfo() determines the EMM
  4571.                       version number and the total and available pages.
  4572.                       This information is saved in the ems structure
  4573.                       passed to EMSinfo().
  4574.   
  4575.                       This function is similar to isEMSavail() and
  4576.                       EMSpages()
  4577.   
  4578.   Return value        returns TRUE if EMS is available and no errors were
  4579.                       encountered. On an error, FALSE is returned and
  4580.                       ems->emserror will contain the error code.
  4581.   
  4582.   Note                this function is available under EMM 3.2 specs.
  4583.   
  4584.   See also            ibm.h
  4585.                       EMMversion(), getEMSstatus(), isEMSavail(),
  4586.                       EMSpages(), EMSwarmbootprep()
  4587.   
  4588.   Example             #include <ibm.h>
  4589.   
  4590.                       main()
  4591.                       {
  4592.                            struct EMSrecord ems;
  4593.   
  4594.                            if (EMSinfo(&ems)) {
  4595.                                 printf("EMM version id: %X\n",
  4596.                                        ems.version);
  4597.                                 printf("Total pages: %u\n",
  4598.                                        ems.totalpages);
  4599.                                 printf("Avail pages: %u\n",
  4600.                                        ems.availpages);
  4601.                            } else                   /* error */
  4602.                                 printf("EMM error code %X\n",
  4603.                                        ems.emserror);
  4604.                       }
  4605.   
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.      TCHK 2.0                                               Page 70
  4628.  
  4629.   
  4630.   Function             EMSpages - determines the total and available
  4631.                                    amount of pages of EMS memory
  4632.   
  4633.   Syntax              boolean EMSpages(struct EMSrecord *ems);
  4634.   
  4635.   Prototype in        ibm.h
  4636.   
  4637.   Remarks             EMSpages() determines the total and available
  4638.                       amount of pages of EMS memory. This information is
  4639.                       saved in the ems structure passed to EMSpages().
  4640.   
  4641.   Return value        returns TRUE if no errors were encountered. On an
  4642.                       error, FALSE is returned and ems->emserror will
  4643.                       contain the error code.
  4644.   
  4645.   Note                this function is available under EMM 3.2 specs.
  4646.   
  4647.   See also            ibm.h
  4648.                       EMMversion(), getEMSstatus(), isEMSavail(),
  4649.                       ESMinfo(), EMSwarmbootprep()
  4650.   
  4651.  
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659.  
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.      TCHK 2.0                                               Page 71
  4694.  
  4695.   
  4696.   Function             EMSwarmbootprep - prepares the EMM for warm boot
  4697.   
  4698.   Syntax              int EMSwarmbootprep(void);
  4699.   
  4700.   Prototype in        ibm.h
  4701.   
  4702.   Remarks             EMSwarmbootprep tells the Expanded Memory Manager
  4703.                       to prepare for a warm boot.
  4704.   
  4705.   Return value        returns the EMM error code. If no errors occurred,
  4706.                       zero is returned. See ibm.h for a list of EMM error
  4707.                       codes.
  4708.   
  4709.   Note                this function is available under EMM 4.0 specs.
  4710.   
  4711.   See also            ibm.h
  4712.                       EMMversion(), getEMSstatus(), isEMSavail(),
  4713.                       ESMinfo(), EMSpages()
  4714.   
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.      TCHK 2.0                                               Page 72
  4760.  
  4761.   
  4762.   Function             endstri - get offset to last char of a string
  4763.   
  4764.   Syntax              #include <stringhk.h>
  4765.                       (int) endstri(s)
  4766.   
  4767.   Prototype in        stringhk.h
  4768.   
  4769.   Remarks             gets an offset to the last character of a string.
  4770.   
  4771.                       This function is a macro. Strings of length 0 will
  4772.                       produce unpredictable results.
  4773.   
  4774.   Return value        returns an int offset to the last character in the
  4775.                       string s.
  4776.   
  4777.   See also            endstri()
  4778.   
  4779.   
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.      TCHK 2.0                                               Page 73
  4826.  
  4827.   
  4828.   Function             endstrp - get pointer to last char of a string
  4829.   
  4830.   Syntax              #include <stringhk.h>
  4831.                       (char *) endstrp(s)
  4832.   
  4833.   Prototype in        stringhk.h
  4834.   
  4835.   Remarks             gets a pointer to the last character of a string.
  4836.   
  4837.                       This function is a macro. Strings of length 0 will
  4838.                       produce unpredictable results.
  4839.   
  4840.   Return value        returns a pointer to the last character in the
  4841.                       string s.
  4842.   
  4843.   See also            endstri()
  4844.   
  4845.   
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.      TCHK 2.0                                               Page 74
  4892.  
  4893.   
  4894.   Function             expandfilespec - expand a filespec into a full
  4895.                                          DOS filepathname
  4896.   
  4897.   Syntax              char *expandfilespec(char *filespec, char *dest);
  4898.   
  4899.   Prototype in        filehk.h
  4900.   
  4901.   Remarks             expandfilespec will take a DOS filespec (optional
  4902.                       drive, optional path, optional file name) and
  4903.                       expand it into a full filepathname, consisting of
  4904.                       drive, path and file name. Any information needed
  4905.                       to make a fully explicit filepathname
  4906.                       (d:\path\filename.exe) not provided by filespec
  4907.                       will be retrieved as the current drive and path,
  4908.                       with the filename.ext wildcarded appropriately.
  4909.   
  4910.                       dest must be a pointer to an allocated piece of
  4911.                       memory large enough to hold the full filepathname
  4912.                       (d:\path\filename.ext).
  4913.   
  4914.                       expandfilespec() relies on parsefilename() to break
  4915.                       s into its respective parts (drive, path and
  4916.                       filename.) Thus, any restrictions applying to
  4917.                       parsefilename() also apply to getfilespec().
  4918.   
  4919.   Return value        returns dest.
  4920.   
  4921.   See also            getfilespec(), isdir(), parsefilename(),
  4922.                       parsefnameext()
  4923.   
  4924.   
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.      TCHK 2.0                                               Page 75
  4958.  
  4959.   
  4960.   Function             Extendedtotal - total Extended memory installed
  4961.   
  4962.   Syntax              int Extendedtotal(void);
  4963.   
  4964.   Prototype in        ibm.h
  4965.   
  4966.   Remarks             detects the total amount of Extended memory
  4967.                       installed.
  4968.   
  4969.   Return value        returns the total Extended memory installed, in
  4970.                       Kbytes.
  4971.   
  4972.   Note                you should check for the presence of Extended
  4973.                       memory with isExtended() before using this
  4974.                       function. Calling Extendedtotal() when no Extended
  4975.                       memory is present can lead to unpredictable
  4976.                       results.
  4977.   
  4978.   See also            isExtended()
  4979.   
  4980.   Example             #include <ibm.h>
  4981.   
  4982.                       main()
  4983.                       {
  4984.                            printf("Total Extended Memory is %dK\n",
  4985.                                 Extendedtotal());
  4986.                       }
  4987.   
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.      TCHK 2.0                                               Page 76
  5024.  
  5025.   
  5026.   Function             factorial - determines a factorial (n!)
  5027.   
  5028.   Syntax              double factorial(int n);
  5029.   
  5030.   Prototype in        mathhk.h
  5031.   
  5032.   Remarks             factorial returns n! (1*2*3*...*n). Traditionally
  5033.                       seen as a recursive function used to illustrate
  5034.                       recursion, factorial is done with a loop, using no
  5035.                       recursion.
  5036.   
  5037.   Return value        returns n factorial (n! = 1*2*3*...*n). If n <= 1,
  5038.                       factorial returns 1. If the result of n! is larger
  5039.                       than MAXDOUBLE (the largest value a double can
  5040.                       store, defined in Borland's LIMITS.H), factorial
  5041.                       return zero.
  5042.   
  5043.   See also            summation()
  5044.   
  5045.   Example             #include <mathhk.h>
  5046.   
  5047.                       main()
  5048.                       {
  5049.                            double f;
  5050.   
  5051.                            if ((f = factorial(13)) == 0)
  5052.                                 printf("Error computing 13!\n");
  5053.                            else
  5054.                                 printf("13! = %15.0lf\n",factorial(13));
  5055.                       }
  5056.   
  5057.   Program output      13! = 6227020800
  5058.   
  5059.   
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.      TCHK 2.0                                               Page 77
  5090.  
  5091.   
  5092.   Function             fname_match - compare filenames w/wildcards
  5093.   
  5094.   Syntax              int fname_match(char *fname1, char *fname2);
  5095.   
  5096.   Prototype in        filehk.h
  5097.   
  5098.   Remarks             compares filename fname1 to fname2 with wildcard
  5099.                       matching (*,?). Case is irrelevant.
  5100.   
  5101.   Return value        return a value
  5102.   
  5103.                            < 0  if fname1 is less than fname2
  5104.                            = 0  if fname1 is the same as fname2
  5105.                            > 0  if fname1 is greater than fname2
  5106.   
  5107.   Note                fname_match() compares strings just like DOS does
  5108.                       (or at least DOS 3.2, the one I work under.) Thus:
  5109.   
  5110.                            "STR*.*" = "str*.*"
  5111.                            "str.d*" = "StR.DZ"
  5112.                            "str" = "str.c"
  5113.   
  5114.                       Very little error checking is done. If an invalid
  5115.                       filename is passed (i.e. more than 12 characters
  5116.                       long) unpredictable results may occur.
  5117.   
  5118.   See also            fncmp()
  5119.   
  5120.   Example             #include <filehk.h>
  5121.   
  5122.                       main()
  5123.                       {
  5124.                            char a[12], b[12];
  5125.                            int cmp;
  5126.   
  5127.                            strcpy(a,"stringhk.c");
  5128.                            strcpy(b,"?TRI*");
  5129.                            printf("%s ",a);
  5130.                            if ((cmp = fname_match(a,b)) == 0)
  5131.                                 printf("=");
  5132.                            else if (cmp < 0)
  5133.                                      printf("<");
  5134.                                 else
  5135.                                      printf(">");
  5136.                            printf(" %s\n",b);
  5137.                       }
  5138.   
  5139.   Program output      stringhk.c = ?TRI*
  5140.   
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.      TCHK 2.0                                               Page 78
  5156.  
  5157.   
  5158.   Function             fncmp - compare filenames w/wildcards
  5159.   
  5160.   Syntax              int fncmp(char *fname1, char *fname2);
  5161.   
  5162.   Prototype in        filehk.h
  5163.   
  5164.   Remarks             compares filename fname1 to fname2 with wildcard
  5165.                       matching (*,?). Case is irrelevant.
  5166.   
  5167.   Return value        return a value
  5168.   
  5169.                            < 0  if fname1 is less than fname2
  5170.                            = 0  if fname1 is the same as fname2
  5171.                            > 0  if fname1 is greater than fname2
  5172.   
  5173.                       In fact, if the value returned is 1 or -1, the
  5174.                       compare failed during the filename portion, and if
  5175.                       2 or -2 is returned, the compare failed during the
  5176.                       extension portion.
  5177.   
  5178.   Note                fncmp() compares strings just like DOS does (or at
  5179.                       least DOS 3.2, the one I work under.) Thus:
  5180.   
  5181.                            "STR*.*" = "str*.*"
  5182.                            "str.d*" = "StR.DZ"
  5183.                            "str" = "str.c"
  5184.   
  5185.                       Very little error checking is done. If an invalid
  5186.                       filename is passed (i.e. more than 12 characters
  5187.                       long) unpredictable results may occur.
  5188.   
  5189.   See also            fname_match()
  5190.   
  5191.   Example             #include <filehk.h>
  5192.   
  5193.                       main()
  5194.                       {
  5195.                            char a[12], b[12];
  5196.                            int cmp;
  5197.   
  5198.                            strcpy(a,"stringhk.c");
  5199.                            strcpy(b,"?TRI*.cc");
  5200.                            printf("%s ",a);
  5201.                            cmp = fncmp(a,b);
  5202.                            printf("Compare:  %s  %s   Yields: %d\n",
  5203.                                   a,b,cmp);
  5204.                       }
  5205.   
  5206.   Program output      Compare: stringhk.c  ?TRI*.cc   Yields: -2
  5207.   
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.      TCHK 2.0                                               Page 79
  5222.  
  5223.   
  5224.   Function             frac - round the fractional portion of a real
  5225.   
  5226.   Syntax              double frac(double x);
  5227.   
  5228.   Prototype in        mathhk.h
  5229.   
  5230.   Remarks             frac will return the fractional portion of x.
  5231.   
  5232.   Return value        returns the fractional portion of x.
  5233.   
  5234.   See also            frac()
  5235.   
  5236.   Example             #include <mathhk.h>
  5237.   
  5238.                       main()
  5239.                       {
  5240.                            printf("frac(%lf) = %lf\n",-2.307,
  5241.                                   frac(-2.307));
  5242.   
  5243.   Program output      frac(-2.307) = -0.307
  5244.   
  5245.   Example             see demonum.c
  5246.   
  5247.   
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.      TCHK 2.0                                               Page 80
  5288.  
  5289.   
  5290.   Function             fsgn - sign of a real
  5291.   
  5292.   Syntax              #include <mathhk.h>
  5293.                       (int) fsgn(x)
  5294.   
  5295.   Prototype in        mathhk.h
  5296.   
  5297.   Remarks             fsgn will determine the sign of x. Zero is
  5298.                       considered positive.
  5299.   
  5300.                       This function is a macro.
  5301.   
  5302.                       The macro fsign() is defined as fsgn().
  5303.   
  5304.   Return value        returns -1 if x is negative, otherwise 1.
  5305.   
  5306.   See also            isgn(), lsgn()
  5307.   
  5308.   
  5309.  
  5310.  
  5311.  
  5312.  
  5313.  
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.      TCHK 2.0                                               Page 81
  5354.  
  5355.   
  5356.   Function             fulltoddate - convert a full date to struct
  5357.   
  5358.   Syntax              struct ddate *fulltoddate(char *source);
  5359.   
  5360.   Prototype in        datehk.h
  5361.   
  5362.   Remarks             fulltoddate converts a date from a full date format
  5363.                       to the structure ddate format
  5364.   
  5365.   Return value        returns a pointer to the storage location
  5366.                       containing the date structure, or NULL if space
  5367.                       could not be allocated.
  5368.   
  5369.   See also            see Appendix A
  5370.                       Cal...(), date_convert(), ddatetofull(),
  5371.                       ddatetoshort(), ddatetostr(), Greg...(), Jul...(),
  5372.                       monthexpand(), shorttoddate(), strtoddate()
  5373.   
  5374.   Example             see demodate.c
  5375.   
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.      TCHK 2.0                                               Page 82
  5420.  
  5421.   
  5422.   Function             FV - calculate the Future Value of a single
  5423.                       amount
  5424.   
  5425.   Syntax              double FV(double payment, double interest, int
  5426.                                 periods)
  5427.   
  5428.   Prototype in        finance.h
  5429.   
  5430.   Remarks             FV calculates the Future Value of a single amount
  5431.                       given the present value of the principal, the
  5432.                       interest rate per period and the number of periods.
  5433.   
  5434.   Return value        returns the future value of a single amount.
  5435.   
  5436.   See also            FVa(), PMT(), PV(), PVa()
  5437.   
  5438.   
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.      TCHK 2.0                                               Page 83
  5486.  
  5487.   
  5488.   Function             FVa - calculate the Future Value of an annuity
  5489.   
  5490.   Syntax              double FVa(double payment, double interest, int
  5491.                                  periods)
  5492.   
  5493.   Prototype in        finance.h
  5494.   
  5495.   Remarks             FVa calculates the Future Value of an annuity given
  5496.                       the amount of each payment, the interest rate per
  5497.                       period and the number of periods.
  5498.   
  5499.   Return value        returns the future value of an annuity.
  5500.   
  5501.   See also            FV(), PMT(), PV(), PVa()
  5502.   
  5503.   
  5504.  
  5505.  
  5506.  
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.      TCHK 2.0                                               Page 84
  5552.  
  5553.   
  5554.   Function             getBootBlock - get Boot Block
  5555.   
  5556.   Syntax              boolean getBootBlock(int drive, struct BootBlock
  5557.                                            *BB)
  5558.   
  5559.   Prototype in        doshk.h
  5560.   
  5561.   Remarks             gets the Boot Block for the disk determined by
  5562.                       drive, where 0=A, 1=B, etc. BB must be a pointer to
  5563.                       an allocated piece of memory.
  5564.   
  5565.   Return value        returns TRUE if successful, otherwise returns FALSE
  5566.                       with the DOS error code in the global variable
  5567.                       errno.
  5568.   
  5569.   See also            getBPB()
  5570.   
  5571.   Example             #include <doshk.h>
  5572.   
  5573.                       main()
  5574.                       {
  5575.                            struct BootBlock BB;
  5576.   
  5577.                            if (getBootBlock(0,&BPB))
  5578.                                 printf("Got it");
  5579.                            else
  5580.                                 printf("Error");
  5581.                       }
  5582.   
  5583.   
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617.      TCHK 2.0                                               Page 85
  5618.  
  5619.   
  5620.   Function             getBPB - get Bios Parameter Block
  5621.   
  5622.   Syntax              boolean getBPB(int drive, struct BIOSParmBlock
  5623.                                      *BPB);
  5624.   
  5625.   Prototype in        doshk.h
  5626.   
  5627.   Remarks             gets the Bios Parameter Block for the disk
  5628.                       determined by drive, where 0=A, 1=B, etc. BPB must
  5629.                       be a pointer to an allocated piece of memory.
  5630.   
  5631.   Return value        returns TRUE if successful, otherwise returns FALSE
  5632.                       with the DOS error code in the global variable
  5633.                       errno.
  5634.   
  5635.   See also            getBootBlock()
  5636.   
  5637.   Example             #include <doshk.h>
  5638.   
  5639.                       main()
  5640.                       {
  5641.                            struct BIOSParmBlock BPB;
  5642.   
  5643.                            if (getBPB(0,&BPB))
  5644.                                 printf("Got it");
  5645.                            else
  5646.                                 printf("Error");
  5647.                       }
  5648.   
  5649.   
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.      TCHK 2.0                                               Page 86
  5684.  
  5685.   
  5686.   Function             getc_match - get specific input, case dependent
  5687.   
  5688.   Syntax              char getc_match(boolean output, char *match);
  5689.   
  5690.   Prototype in        keyboard.h
  5691.   
  5692.   Remarks             getc_match accepts character input (via getk())
  5693.                       until one of the characters in the string match in
  5694.                       entered, case dependent ('a' != 'A'). Extended keys
  5695.                       never match (F10 will never be a match.) If output
  5696.                       = TRUE, the character is echoed to the screen via
  5697.                       putk().
  5698.   
  5699.   Return value        returns the key pressed.
  5700.   
  5701.   See also            getc_match(), getk(), getlogical(), getyn()
  5702.   
  5703.   Example             #include <keyboard.h>
  5704.   
  5705.                       main()
  5706.                       {
  5707.                            printf("Enter your choice (abcdHJ): ");
  5708.                            getc_match(1,"abcdHJ");
  5709.                       }
  5710.   
  5711.   Program output      Enter your choice (abcdHJ): H
  5712.   
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.      TCHK 2.0                                               Page 87
  5750.  
  5751.   
  5752.   Function             getci_match - get specific input, case
  5753.                                       independent
  5754.   
  5755.   Syntax              char getci_match(boolean output, char *match);
  5756.   
  5757.   Prototype in        keyboard.h
  5758.   
  5759.   Remarks             getci_match accepts character input (via getk())
  5760.                       until one of the characters in the string match in
  5761.                       entered, case independent ('a' == 'A'). Extended
  5762.                       keys never match (F10 will never be a match.) If
  5763.                       output = TRUE, the character is echoed to the
  5764.                       screen via putch().
  5765.   
  5766.   Return value        returns the key pressed.
  5767.   
  5768.   See also            getc_match(), getk(), getlogical(), getyn()
  5769.   
  5770.   Example             #include <keyboard.h>
  5771.   
  5772.                       main()
  5773.                       {
  5774.                            printf("Enter your choice (Q, X, F, D): ");
  5775.                            getci_match(1,"QXFD");
  5776.                       }
  5777.   
  5778.   Program output      Enter your choice (Q, X, F, D): f
  5779.   
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.      TCHK 2.0                                               Page 88
  5816.  
  5817.   
  5818.   Function             getcursor - gets cursor scan lines
  5819.   
  5820.   Syntax              unsigned int getcursor(void);
  5821.   
  5822.   Prototype in        video.h
  5823.   
  5824.   Remarks             gets the cursor scan lines via INT 0x10, Function
  5825.                       3.
  5826.   
  5827.   Return value        returns the scan lines of the cursor, with the
  5828.                       starting scan line in the high order byte and the
  5829.                       ending scan line in the low order byte.
  5830.   
  5831.   See also            cursor_blink(), cursor_flip(), cursor_off(),
  5832.                       cursor_on(), read_cursor(), set_cursor(),
  5833.                       setcursor()
  5834.   
  5835.   
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.  
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.      TCHK 2.0                                               Page 89
  5882.  
  5883.   
  5884.   Function             getdatehk - inputs a date from the keyboard
  5885.   
  5886.   Syntax              char *getdatehk(void);
  5887.   
  5888.   Prototype in        keyboard.h
  5889.   
  5890.   Remarks             getdatehk inputs a date from the keyboard in the
  5891.                       form xx-xx-xx. Only digits, space and backspace are
  5892.                       valid input. Input is terminated when the ENTER key
  5893.                       is pressed. Video output is via Borland's console
  5894.                       i/o.
  5895.   
  5896.   Return value        if a valid date is entered, getdatehk returns a
  5897.                       string in the form xx-xx-xx, otherwise NULL is
  5898.                       returned.
  5899.   
  5900.   Example             #include <keyboard.h>
  5901.                       #include <stdio.h>
  5902.                       main()
  5903.                       {
  5904.                            char *c;
  5905.   
  5906.                            printf("What is today's date: ");
  5907.                            if ((c = getdatehk()) != NULL)
  5908.                                 printf("Today is %s\n",c);
  5909.                       }
  5910.   
  5911.   Program output      What is today's date: 11-10-87
  5912.                       Today is 11-10-87
  5913.   
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.      TCHK 2.0                                               Page 90
  5948.  
  5949.   
  5950.   Function             getdouble - inputs a double from the keyboard
  5951.   
  5952.   Syntax              char *getdouble(void);
  5953.   
  5954.   Prototype in        keyboard.h
  5955.   
  5956.   Remarks             getdouble inputs a double from the keyboard. Only
  5957.                       digits, decimal point, leading sign and backspace
  5958.                       are valid input. Input is terminated when the ENTER
  5959.                       key is pressed. Video output is via Borland's
  5960.                       console i/o.
  5961.   
  5962.                       The maximum length of input is 25.
  5963.   
  5964.   Return value        returns a string of the format     [sn] [ddd] [.]
  5965.                       [ddd] where
  5966.   
  5967.                            [sn]  = optional sign (+ or -)
  5968.                            [ddd] = optional digits
  5969.                            [.]   = optional decimal point
  5970.   
  5971.   See also            getint(), getreal()
  5972.   
  5973.   Example             #include <keyboard.h>
  5974.                       #include <stdio.h>
  5975.                       main()
  5976.                       {
  5977.                            char *c;
  5978.   
  5979.                            printf("Give me a double: ");
  5980.                            c = getdouble();
  5981.                            printf("Your input is %s\n",c);
  5982.                       }
  5983.   
  5984.   Program output      Give me a double: -1289.12003
  5985.                       Your input is -1289.12003
  5986.   
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.      TCHK 2.0                                               Page 91
  6014.  
  6015.   
  6016.   Function             getEMSstatus - get Expanded Memory status
  6017.   
  6018.   Syntax              byte getEMSstatus(void);
  6019.   
  6020.   Prototype in        ibm.h
  6021.   
  6022.   Remarks             getEMSstatus tests whether the expanded memory
  6023.                       hardware is functional. This function should only
  6024.                       be made after it has been established that EMS is
  6025.                       available and the EMM is ready (via isEMSavail()).
  6026.                       This is not a substitute to determine if EMS is
  6027.                       available.
  6028.   
  6029.   Return value        returns the EMM error code. If zero is returned,
  6030.                       the function is successful. If any other value is
  6031.                       returned, an error has occurred.
  6032.   
  6033.   Note                this function is available under EMM 3.2 specs.
  6034.   
  6035.   See also            ibm.h
  6036.                       EMMversion(), isEMSavail(), ESMinfo(), EMSpages(),
  6037.                       EMSwarmbootprep()
  6038.   
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.      TCHK 2.0                                               Page 92
  6080.  
  6081.   
  6082.   Function             getfilespec - get a DIR proper filespec
  6083.   
  6084.   Syntax              char *getfilespec(char *s);
  6085.   
  6086.   Prototype in        filehk.h
  6087.   
  6088.   Remarks             getfilespec parses a string pointed to by s for a
  6089.                       file name. Any drive and path information is
  6090.                       stripped from the string and the filename.ext is
  6091.                       expanded with wildcards, as DIR does internally
  6092.                       (i.e. c:tchk.lib has a filename.ext of tchk.lib amd
  6093.                       c:tchk. has a filenameext of tchk., but c:tchk has
  6094.                       a filename.ext of tchk.*). The original string s is
  6095.                       modified.
  6096.   
  6097.                       getfilespec() relies on parsefilename() to strip
  6098.                       any drive and path information from s. Thus, any
  6099.                       restrictions applying to parsefilename() also apply
  6100.                       to getfilespec().
  6101.   
  6102.   Return value        returns a pointer to s.
  6103.   
  6104.   See also            parsefilename(), parsefnameext()
  6105.   
  6106.   Example             see demopars.c
  6107.   
  6108.   
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.      TCHK 2.0                                               Page 93
  6146.  
  6147.   
  6148.   Function             getfname - get a filename from the keyboard
  6149.   
  6150.   Syntax              int getfname(byte row, byte col, char *returnstr,
  6151.                                    char *pattern, int argn, int argk[],
  6152.                                    char flags);
  6153.   
  6154.   Prototype in        video.h
  6155.   
  6156.   Remarks             getfname calls getget() asking for input of a
  6157.                       length 12 string, at the coordinates (col,row),
  6158.                       including pattern formatting and optional input
  6159.                       exit keys listed in argk. If memory was allocated
  6160.                       for returnstr, the string pointed to by returnstr
  6161.                       is checked to see if it is a valid DOS filename. A
  6162.                       valid filename must be of the form
  6163.                            [filename] [.] [ext]    and does not contain
  6164.                       any of the following:
  6165.   
  6166.                            [ ] ; , . / ? * : " + = - < > \ |
  6167.   
  6168.                       If memory could not be allocated for the string,
  6169.                       returnstr will be set to NULL.
  6170.   
  6171.                       For more info on pattern and argk requirements,
  6172.                       check the stats for getget().
  6173.   
  6174.   Return value        if memory could not be allocated for returnstr or
  6175.                       the string pointed to by returnstr is not a valid
  6176.                       filename, -1 is returned, otherwise the key used to
  6177.                       exit the input is returned.
  6178.   
  6179.   See also            getget()
  6180.   
  6181.   Example             #include <filehk.h>
  6182.                       #include <keycode.h>
  6183.   
  6184.                       main()
  6185.                       {
  6186.                            char *fname;
  6187.                            int keys[2]={ESC,F10};   /* ESC & F10 exit
  6188.                            input */
  6189.   
  6190.                            gotoxy(0,0);
  6191.                            printf("Enter file: ");
  6192.                            if (getfname(0,13,fname,"!",2,keys) == -1)
  6193.                                 printf("    BAD FILENAME");
  6194.                            else
  6195.                                 printf("    valid filename");
  6196.                       }
  6197.   
  6198.   Program output      
  6199.   
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.      TCHK 2.0                                               Page 94
  6212.  
  6213.   
  6214.   Function             getget - get a string from the keyboard w/editing
  6215.   
  6216.   Syntax              int getget(int col, int row, char *returnstr,
  6217.                                  int size, char *pattern, int argn,
  6218.                                  int argk[], char flags);
  6219.   
  6220.   Prototype in        keyboard.h
  6221.   
  6222.   Remarks             getget inputs a string at coordinates (col,row), of
  6223.                       maximum length size, formatted according to
  6224.                       pattern. Input ends when ENTER or one of the scan
  6225.                       codes specified in argk[] in inputted. There are
  6226.                       argn number of elements in argk[]. The string is
  6227.                       returned in returnstr and the function returns the
  6228.                       key code of the exiting key.
  6229.   
  6230.                       Full feature editing of the string includes:
  6231.   
  6232.                            Enter          Ends input, exits function
  6233.                            Backspace      normal backspace
  6234.                            Insert         toggle inset/overwrite mode
  6235.                            Delete         delete character under cursor
  6236.                            Left Arrow     move cursor back 1 character
  6237.                            Right Arrow    move cursor forward 1 character
  6238.                            Home           move cursor to beginning of
  6239.                                           string
  6240.                            End            move cursor to end of string
  6241.                            Ctrl-Y         delete entire string
  6242.                            Alt-Y          delete string from cursor to
  6243.                                           end
  6244.                            Ctrl-Right     move cursor to beginning of
  6245.                                           next word
  6246.                            Ctrl-Left      move cursor to beginning of
  6247.                                           previous word
  6248.                            Alt-U          undo editing - restore initial
  6249.                                           string
  6250.   
  6251.                       Here are the valid patterns:
  6252.   
  6253.                                  pattern     format
  6254.                                  -------     ------
  6255.                       Types          a       Alphabetic
  6256.                                      A       Alphabetic and capitalized
  6257.                                      h       Hexadecimal
  6258.                                      H       Hexadecimal and capitalized
  6259.                                      n       Alphanumeric
  6260.                                      N       Alphanumeric and capitalized
  6261.                                      X       Ascii (default)
  6262.                                      9       Numeric
  6263.                                      #       Numeric and punctuation
  6264.   
  6265.                       Modifiers      !       convert to upper case
  6266.                                      .       punctuation
  6267.   
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.      TCHK 2.0                                               Page 95
  6278.  
  6279.                                      (       left justify
  6280.                                      )       right justify
  6281.                                      ^       center justify
  6282.   
  6283.                       The flags modifier is a bit field of flags, as
  6284.                       follows:
  6285.   
  6286.                                 xxxxBLRI     where
  6287.   
  6288.                                 B =  Bell
  6289.                                 L =  trim Left side on exit
  6290.                                 R =  trim Right side on exit
  6291.                                 I =  start edit in Insert mode (as
  6292.                                      opposed to Overwrite mode)
  6293.   
  6294.                       Input is done via the inkey() function.
  6295.   
  6296.                       Video output is via Borland's console i/o.
  6297.   
  6298.   Return value        returns the key code of the key causing the exit
  6299.   
  6300.   See also            getstr()
  6301.   
  6302.   
  6303.  
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.      TCHK 2.0                                               Page 96
  6344.  
  6345.   
  6346.   Function             getint - inputs an integer from the keyboard
  6347.   
  6348.   Syntax              char *getint(void);
  6349.   
  6350.   Prototype in        keyboard.h
  6351.   
  6352.   Remarks             getint inputs an integer from the keyboard. Only
  6353.                       digits, leading sign and backspace are valid input.
  6354.                       Input is terminated when the ENTER key is pressed.
  6355.   
  6356.                       the maximum length of input is 25.
  6357.   
  6358.                       Video output is via Borland's console i/o.
  6359.   
  6360.   Return value        returns a string of the format  [sn] [ddd]  where
  6361.   
  6362.                            [sn]  = optional sign (+ or -)
  6363.                            [ddd] = optional digits
  6364.   
  6365.   See also            getdouble(), getreal()
  6366.   
  6367.   Example             #include <keyboard.h>
  6368.                       #include <stdio.h>
  6369.                       main()
  6370.                       {
  6371.                            char *c;
  6372.   
  6373.                            printf("Give me an integer: ");
  6374.                            c = getint();
  6375.                            printf("Your input is %s\n",c);
  6376.                       }
  6377.   
  6378.   Program output      Give me an integer: -1289
  6379.                       Your input is -1289
  6380.   
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.      TCHK 2.0                                               Page 97
  6410.  
  6411.   
  6412.   Function             getk - get a key
  6413.   
  6414.   Syntax              byte getk(boolean wait);
  6415.   
  6416.   Prototype in        keyboard.h
  6417.   
  6418.   Remarks             getk returns the ascii code of the key pressed. If
  6419.                       no key was pressed (WAIT = FALSE) zero is returned.
  6420.                       This function is similar to getchar() except input
  6421.                       is not echoed to the screen and getk will detect
  6422.                       any key press (any standard keypress. It cannot
  6423.                       distinguish between the grey '+' key and the white
  6424.                       '+'. This function is interrupt driven. It will
  6425.                       detect ALT combinations, Del, PgUp, function keys,
  6426.                       etc., any keyboard INTerrupt accepted keys.)
  6427.   
  6428.   Return value        returns the ascii code for the key pressed, from 1
  6429.                       to 255. If WAIT = FALSE, and no key is pressed,
  6430.                       zero is returned. Check the global variables
  6431.                       key_status and key_extended to determine the shift
  6432.                       key status and if the key is an extended one.
  6433.   
  6434.   See also            keycode.h
  6435.                       getc_match(), getc_match(), getlogical(), getyn(),
  6436.                       inkey(), inkeyc()
  6437.   
  6438.   Example             #include <keyboard.h>
  6439.                       #include <stdio.h>
  6440.   
  6441.                       main()
  6442.                       {
  6443.                            extern boolean key_extended;
  6444.                            byte c;
  6445.   
  6446.                            c = getk(WAIT);
  6447.                            printf("Key code # in keycode.h: %d\n",
  6448.                                 key_extended ? c+256 : c);
  6449.                       }
  6450.   
  6451.   
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.      TCHK 2.0                                               Page 98
  6476.  
  6477.   
  6478.   Function             getlogical - get Yes/No
  6479.   
  6480.   Syntax              char getlogical(int output);
  6481.   
  6482.   Prototype in        keyboard.h
  6483.   
  6484.   Remarks             getlogical waits for a True/False key (TtFfYyNn) to
  6485.                       be pressed and then displays a message via putstr()
  6486.                       according to output:
  6487.   
  6488.                            output         Message displayed
  6489.                            ------         -----------------
  6490.                              0                 no message
  6491.                              1                 T or F or Y or N
  6492.                              2                 True or False or Yes or No
  6493.   
  6494.                       getlogical is case independent.
  6495.   
  6496.                       Video output is via Borland's console i/o.
  6497.   
  6498.   Return value        returns 'Y' or 'N'
  6499.   
  6500.   See also            getc_match(), getci_match(), getk(), getyn(),
  6501.                       inkey(), inkeyc()
  6502.   
  6503.   Example             #include <keyboard.h>
  6504.   
  6505.                       main()
  6506.                       {
  6507.                            printf("This is good? ");
  6508.                            getlogical(2);
  6509.                       }
  6510.   
  6511.   
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.      TCHK 2.0                                               Page 99
  6542.  
  6543.   
  6544.   Function             getreal - inputs a real from the keyboard
  6545.   
  6546.   Syntax              char *getreal(int size, int decimal);
  6547.   
  6548.   Prototype in        keyboard.h
  6549.   
  6550.   Remarks             getreal inputs a real (double) from the keyboard.
  6551.                       Only digits, decimal place, leading sign and
  6552.                       backspace are valid input. Input is terminated when
  6553.                       the ENTER key is pressed.
  6554.   
  6555.                       the maximum length of input is size and the maximum
  6556.                       number of decimal places is decimal. When
  6557.                       calculating size, you must leave enough room for
  6558.                       decimal, plus the number of places of the leading
  6559.                       integer, one for the decimal point and one for the
  6560.                       leading sign.
  6561.   
  6562.                       Video output is via Borland's console i/o.
  6563.   
  6564.   Return value        returns a string of the format  [sn] [ddd] [.]
  6565.                       [ddd] where
  6566.   
  6567.                            [sn]  = optional sign (+ or -)
  6568.                            [ddd] = optional digits
  6569.                            [.]   = optional decimal point
  6570.   
  6571.   See also            getdouble(), getint()
  6572.   
  6573.   Example             #include <keyboard.h>
  6574.                       #include <stdio.h>
  6575.                       main()
  6576.                       {
  6577.                            char *c;
  6578.   
  6579.                            printf("Give me a real: ");
  6580.                            c = getreal(8,2);
  6581.                            printf("Your input is %s\n",c);
  6582.                       }
  6583.   
  6584.   Program output      Give me a real: -1012.30
  6585.                       Your input is -1012.30
  6586.   
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.      TCHK 2.0                                               Page 100
  6608.  
  6609.   
  6610.   Function             getstr - input a string from the keyboard
  6611.   
  6612.   Syntax              char *getstr(int size, char *pattern);
  6613.   
  6614.   Prototype in        keyboard.h
  6615.   
  6616.   Remarks             getstr inputs a string from the keyboard, of
  6617.                       maximum length size, given a format pattern. See
  6618.                       getget() for a list of format modifiers.
  6619.                       The only other valid keys are backspace and ENTER.
  6620.   
  6621.                       Video output is via Borland's console i/o.
  6622.   
  6623.   Return value        returns a pointer to the storage location
  6624.                       containing the formatted string, or NULL if space
  6625.                       could not be allocated.
  6626.   
  6627.   See also            getget()
  6628.   
  6629.   Example             #include <keyboard.h>
  6630.                       #include <stdio.h>
  6631.   
  6632.                       main()
  6633.                       {
  6634.                            char *f, *l, *s, *c;
  6635.   
  6636.                            printf("First name: ");
  6637.                            f = getget(10,"A");
  6638.                            printf("Last name: ");
  6639.                            l = getget(20,"a");
  6640.                            printf("SS#: ");
  6641.                            s = getget(8,"9");
  6642.                            printf("Comments: ");
  6643.                            c = getget(60,"");
  6644.                       }
  6645.   
  6646.   Program output      First name: HOWARD
  6647.                       Last name: kapustein
  6648.                       SS#: 123456789
  6649.                       Comments: The empty quotes defaults to X.
  6650.   
  6651.  
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.      TCHK 2.0                                               Page 101
  6674.  
  6675.   
  6676.   Function             getyn - get Yes/No
  6677.   
  6678.   Syntax              char getyn(int output);
  6679.   
  6680.   Prototype in        keyboard.h
  6681.   
  6682.   Remarks             getyn waits for a Y or N to be pressed and then
  6683.                       displays a message via putstr() according to
  6684.                       output:
  6685.   
  6686.                            output         Message displayed
  6687.                            ------         -----------------
  6688.                              0                 no message
  6689.                              1                 Y or N
  6690.                              2                 Yes or No
  6691.   
  6692.                       getyn is case independent.
  6693.   
  6694.                       Video output is via Borland's console i/o.
  6695.   
  6696.   Return value        returns 'Y' or 'N'
  6697.   
  6698.   See also            getc_match(), getk(), getc_match(), getlogical(),
  6699.                       inkey(), inkeyc()
  6700.   
  6701.   Example             #include <keyboard.h>
  6702.   
  6703.                       main()
  6704.                       {
  6705.                            printf("Is this OK? ");
  6706.                            getyn(2);
  6707.                       }
  6708.   
  6709.   
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.  
  6739.      TCHK 2.0                                               Page 102
  6740.  
  6741.   
  6742.   Function             gotohv - move cursor to absolute coordinates
  6743.   
  6744.   Syntax              void gotohv(int h, int v);
  6745.   
  6746.   Prototype in        video.h
  6747.   
  6748.   Remarks             gotoxy puts cursor at absolute screen coordinates
  6749.                       (h,v) via INT 0x10, Service 2. The top left corner
  6750.                       of the screen is referred to by (0,0).
  6751.   
  6752.                       This is NOT the same as Borland's gotoxy().
  6753.                       Borland's function is affected by the window()
  6754.                       settings, whereas gotohv() is not.
  6755.   
  6756.   Return value        nothing.
  6757.   
  6758.   See also            read_cursor(), whereh(), wherev()
  6759.   
  6760.   Example             #include <video.h>
  6761.   
  6762.                       main()
  6763.                       {
  6764.                            gotohv(0,0);
  6765.                       }
  6766.   
  6767.   
  6768.  
  6769.  
  6770.  
  6771.  
  6772.  
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.  
  6792.  
  6793.  
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.      TCHK 2.0                                               Page 103
  6806.  
  6807.   
  6808.   Function             Greg... - family of Gregorian date conversion
  6809.                                   functions
  6810.   
  6811.   Syntax              double GregtoCal(char *greg);
  6812.                       double GregtoCalCent(char *greg);
  6813.   
  6814.                       double GregEurotoCal(char *greg);
  6815.                       double GregEurotoCalCent(char *greg);
  6816.   
  6817.                       double GregJaptoCal(char *greg);
  6818.                       double GregJaptoCalCent(char *greg);
  6819.   
  6820.   Prototype in        datehk.h
  6821.   
  6822.   Remarks             GregtoCal      converts Gregorian (US) dates to
  6823.                                      Calendar dates
  6824.                       GregtoCalCent       converts Gregorian (US) dates
  6825.                                           to Calendar dates (w/century)
  6826.   
  6827.                       GregEurotoCal       converts Gregorian (European)
  6828.                                           dates to Calendar dates
  6829.                       GregEurotoCalCent   converts Gregorian (European)
  6830.                                           dates to Calendar dates
  6831.                                           (w/century)
  6832.   
  6833.                       GregJaptoCal        converts Gregorian (Japan)
  6834.                                           dates to Calendar dates
  6835.                       GregJaptoCalCent    converts Gregorian (Japan)
  6836.                                           dates to Calendar dates
  6837.                                           (w/century)
  6838.   
  6839.   Return value        GregtoCal, GregEurotoCal, GregJaptoCal return a
  6840.                            Calendar date
  6841.                       GregtoCalCent, GregEurotoCalCent, GregJaptoCalCent
  6842.                            return a Calendar date (w/century)
  6843.   
  6844.   See also            Appendix A
  6845.                       Cal...(), date_convert(), ddatetofull(),
  6846.                       ddatetoshort(), ddatetostr(), fulltoddate(),
  6847.                       Jul...(), monthexpand(), shorttoddate(),
  6848.                       strtoddate()
  6849.   
  6850.   Example             see demodate.c
  6851.   
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.      TCHK 2.0                                               Page 104
  6872.  
  6873.   
  6874.   Function             horiz_line - draw a horizontal line
  6875.   
  6876.   Syntax              void horiz_line(byte c, int len, int col, int row);
  6877.   
  6878.   Prototype in        video.h
  6879.   
  6880.   Remarks             draws a horizontal line of characters c of length
  6881.                       len beginning at (col,row) via INTerrupts, using
  6882.                       the current char_attribute setting for color.
  6883.                       Screen coordinates are absolute.
  6884.   
  6885.                       horiz_line does no error checking on the passed
  6886.                       parameters.
  6887.   
  6888.   Return value        nothing.
  6889.   
  6890.   See also            box(), restore_box(), restore_screen(), save_box(),
  6891.                       save_screen(), vert_line()
  6892.   
  6893.   Example             #include <video.h>
  6894.   
  6895.                       main()
  6896.                       {
  6897.                            horiz_line('*',7,4,4);   /* draw 7 *'s */
  6898.                       }
  6899.   
  6900.   
  6901.  
  6902.  
  6903.  
  6904.  
  6905.  
  6906.  
  6907.  
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927.  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.  
  6933.  
  6934.  
  6935.  
  6936.  
  6937.      TCHK 2.0                                               Page 105
  6938.  
  6939.   
  6940.   Function             inkey - get a key
  6941.   
  6942.   Syntax              int inkey(boolean wait);
  6943.   
  6944.   Prototype in        keyboard.h
  6945.   
  6946.   Remarks             inkey returns the key code of the key pressed. If
  6947.                       no key was pressed (WAIT = FALSE) 0 is returned.
  6948.                       This function is similar to getchar() except input
  6949.                       is not echoed to the screen and inkey will detect
  6950.                       any key press (any standard keypress. It cannot
  6951.                       distinguish between the grey '+' key and the white
  6952.                       '+'. This function is interrupt driven. It will
  6953.                       detect ALT combinations, Del, PgUp, function keys,
  6954.                       etc., any keyboard INTerrupt accepted keys.)
  6955.   
  6956.   Return value        returns the key code of the key pressed, from 1 to
  6957.                       511. If WAIT = FALSE, and no key is pressed, zero
  6958.                       is returned.
  6959.   
  6960.   See also            keycode.h
  6961.                       getc_match(), getk(), getc_match(), getlogical(),
  6962.                       getyn(), inkeyc(), tocapkey()
  6963.   
  6964.   Example             #include <keyboard.h>
  6965.                       #include <stdio.h>
  6966.   
  6967.                       main()
  6968.                       {
  6969.                            int c;
  6970.   
  6971.                            c = inkey(WAIT);
  6972.                            printf("Key code # in keycode.h: %d\n", c);
  6973.                       }
  6974.   
  6975.   
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991.  
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.      TCHK 2.0                                               Page 106
  7004.  
  7005.   
  7006.   Function             inkeyc - get a key, any alphabetics capitalized
  7007.   
  7008.   Syntax              int inkeyc(boolean wait);
  7009.   
  7010.   Prototype in        keyboard.h
  7011.   
  7012.   Remarks             inkeyc returns the key code of the key pressed. If
  7013.                       no key was pressed (WAIT = FALSE) 0 is returned.
  7014.                       Any letters detected are capitalized before being
  7015.                       returned. This function is similar to getchar()
  7016.                       except input is not echoed to the screen and inkeyc
  7017.                       will detect any key press (any standard keypress.
  7018.                       It cannot distinguish between the grey '+' key and
  7019.                       the white '+'. This function is interrupt driven.
  7020.                       It will detect ALT combinations, Del, PgUp,
  7021.                       function keys, etc., any keyboard INTerrupt
  7022.                       accepted keys.)
  7023.   
  7024.   Return value        returns the key code of the key pressed, from 1 to
  7025.                       511, all letters are capitalized. If WAIT = FALSE,
  7026.                       and no key is pressed, zero is returned.
  7027.   
  7028.   See also            keycode.h
  7029.                       getc_match(), getk(), getc_match(), getlogical(),
  7030.                       getyn(), inkey(), tocapkey()
  7031.   
  7032.   Example             #include <keyboard.h>
  7033.                       #include <stdio.h>
  7034.   
  7035.                       main()
  7036.                       {
  7037.                            int c;
  7038.   
  7039.                            c = inkeyc(WAIT);
  7040.                            printf("Key code # in keycode.h: %d\n", c);
  7041.                       }
  7042.   
  7043.   
  7044.  
  7045.  
  7046.  
  7047.  
  7048.  
  7049.  
  7050.  
  7051.  
  7052.  
  7053.  
  7054.  
  7055.  
  7056.  
  7057.  
  7058.  
  7059.  
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.      TCHK 2.0                                               Page 107
  7070.  
  7071.   
  7072.   Function             intlen - calculate length of integer in a string
  7073.   
  7074.   Syntax              int intlen(char *number);
  7075.   
  7076.   Prototype in        stringhk.h
  7077.   
  7078.   Remarks             intlen calculates the length of an integer in the
  7079.                       string number. The integer is terminated by a
  7080.                       non-digit (any character other than 0-9.) This
  7081.                       function is used internally by strcomma.
  7082.   
  7083.   Return value        the length of the integer pointed to by number.
  7084.   
  7085.   Example             #include <stringhk.h>
  7086.                       #include <stdio.h>            /* for the printf */
  7087.                       #include <alloc.h>            /* for the calloc */
  7088.   
  7089.                       main()
  7090.                       {
  7091.                            char *sint[15];
  7092.                            int len;
  7093.   
  7094.                            strcpy(sint,"1839.44");
  7095.                            printf("String: %s    Length of integer: %d\n"
  7096.                                   , sint, intlen(sint));
  7097.                            strcpy(sint,"19,848");
  7098.                            printf("String: %s    Length of integer: %d\n"
  7099.                                   , sint, intlen(sint));
  7100.                            strcpy(sint,"44x993");
  7101.                            printf("String: %s    Length of integer: %d\n"
  7102.                                   , sint, intlen(sint));
  7103.                       }
  7104.   
  7105.   Program output      String: 1839.44    Length of integer: 4
  7106.                       String: 19,848    Length of integer: 2
  7107.                       String: 44x993    Length of integer: 2
  7108.   
  7109.   
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.      TCHK 2.0                                               Page 108
  7136.  
  7137.   
  7138.   Function             InsLock - set the Insert key state
  7139.   
  7140.   Syntax              void InsLock(boolean on);
  7141.   
  7142.   Prototype in        ibm.h
  7143.   
  7144.   Remarks             sets the Insert key state to the state selected by
  7145.                       the on parameter.
  7146.   
  7147.   Return value        nothing.
  7148.   
  7149.   See also            CapsLock(), NumLock(), SrollLock()
  7150.   
  7151.  
  7152.  
  7153.  
  7154.  
  7155.  
  7156.  
  7157.  
  7158.  
  7159.  
  7160.  
  7161.  
  7162.  
  7163.  
  7164.  
  7165.  
  7166.  
  7167.  
  7168.  
  7169.  
  7170.  
  7171.  
  7172.  
  7173.  
  7174.  
  7175.  
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.  
  7189.  
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.      TCHK 2.0                                               Page 109
  7202.  
  7203.   
  7204.   Function             isAppendavail - is APPEND installed
  7205.   
  7206.   Syntax              boolean isAppendavail(void);
  7207.   
  7208.   Prototype in        doshk.h
  7209.   
  7210.   Remarks             checks if APPEND is installed.
  7211.   
  7212.   Return value        returns TRUE if APPEND is installed, FALSE
  7213.                       otherwise.
  7214.   
  7215.   See also            isAssignavail(), isShareAvail()
  7216.   
  7217.   Example             #include <ibm.h>
  7218.   
  7219.                       main()
  7220.                       {
  7221.                            printf("APPEND is ");
  7222.                            if (! isAppendavail())
  7223.                                 printf("not ");
  7224.                            printf("installed\n");
  7225.                       }
  7226.   
  7227.  
  7228.  
  7229.  
  7230.  
  7231.  
  7232.  
  7233.  
  7234.  
  7235.  
  7236.  
  7237.  
  7238.  
  7239.  
  7240.  
  7241.  
  7242.  
  7243.  
  7244.  
  7245.  
  7246.  
  7247.  
  7248.  
  7249.  
  7250.  
  7251.  
  7252.  
  7253.  
  7254.  
  7255.  
  7256.  
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.      TCHK 2.0                                               Page 110
  7268.  
  7269.   
  7270.   Function             isAssignavail - is ASSIGN installed
  7271.   
  7272.   Syntax              boolean isAssignavail(void);
  7273.   
  7274.   Prototype in        doshk.h
  7275.   
  7276.   Remarks             checks if ASSIGN is installed.
  7277.   
  7278.   Return value        returns TRUE if ASSIGN is installed, FALSE
  7279.                       otherwise.
  7280.   
  7281.   See also            isAppendavail(), isShareAvail()
  7282.   
  7283.   Example             #include <ibm.h>
  7284.   
  7285.                       main()
  7286.                       {
  7287.                            printf("ASSIGN is ");
  7288.                            if (! isAssignavail())
  7289.                                 printf("not ");
  7290.                            printf("installed\n");
  7291.                       }
  7292.   
  7293.  
  7294.  
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.  
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.  
  7324.  
  7325.  
  7326.  
  7327.  
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.      TCHK 2.0                                               Page 111
  7334.  
  7335.   
  7336.   Function             isBlogical - is drive B: logical
  7337.   
  7338.   Syntax              boolean isBlogical(void);
  7339.   
  7340.   Prototype in        ibm.h
  7341.   
  7342.   Remarks             checks if drive B: is logical or physical
  7343.   
  7344.   Return value        returns TRUE if drive B: is logical, FALSE
  7345.                       otherwise.
  7346.   
  7347.   Example             #include <ibm.h>
  7348.   
  7349.                       main()
  7350.                       {
  7351.                            printf("Drive B: is ");
  7352.                            if (isBlogical())
  7353.                                 printf("logical\n");
  7354.                            else
  7355.                                 printf("physical\n");
  7356.                       }
  7357.   
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380.  
  7381.  
  7382.  
  7383.  
  7384.  
  7385.  
  7386.  
  7387.  
  7388.  
  7389.  
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.      TCHK 2.0                                               Page 112
  7400.  
  7401.   
  7402.   Function             isBREAKon - check Ctrl-BREAK flag
  7403.   
  7404.   Syntax              #include <ibm.h>
  7405.                       isBREAKon();
  7406.   
  7407.   Prototype in        ibm.h
  7408.   
  7409.   Remarks             checks the state of the Ctrl-BREAK flag. The BREAK
  7410.                       status flag can be set from DOS by BREAK ON or
  7411.                       BREAK OFF.
  7412.   
  7413.                       This function is a macro.
  7414.   
  7415.   Return value        returns TRUE if the break flag is on, FALSE if the
  7416.                       flag is off.
  7417.   
  7418.   See also            isVERIFYon(), setBREAK(), setVERIFY()
  7419.   
  7420.   Example             #include <ibm.h>
  7421.   
  7422.                       main()
  7423.                       {
  7424.                            printf("BREAK flag is ");
  7425.                            if (! isBREAKon())
  7426.                                 printf("not ");
  7427.                            printf("on\n");
  7428.                       }
  7429.   
  7430.  
  7431.  
  7432.  
  7433.  
  7434.  
  7435.  
  7436.  
  7437.  
  7438.  
  7439.  
  7440.  
  7441.  
  7442.  
  7443.  
  7444.  
  7445.  
  7446.  
  7447.  
  7448.  
  7449.  
  7450.  
  7451.  
  7452.  
  7453.  
  7454.  
  7455.  
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.  
  7465.      TCHK 2.0                                               Page 113
  7466.  
  7467.   
  7468.   Function             isCGA - is Color Graphics adapter installed
  7469.                        isEGA - is Enhanced Graphics adapter installed
  7470.                        isHerc - is Hercules Graphics adapter installed
  7471.                        isMDA - is Monochrome adapter installed
  7472.   
  7473.                        ismono - is monochrome display
  7474.                        iscolor - is color display
  7475.   
  7476.   Syntax              boolean isMDA(void);
  7477.                       boolean isCGA(void);
  7478.                       boolean isEGA(void);
  7479.                       boolean isHerc(void);
  7480.   
  7481.                       #include <video.h>
  7482.                       ismono()
  7483.                       iscolor()
  7484.   
  7485.   Prototype in        video.h
  7486.   
  7487.   Remarks             is...() check if a video adapter is present.
  7488.                       ismono() checks if the display is mono.
  7489.                       iscolor() checks if the display is color.
  7490.   
  7491.                       The ismono() and iscolor() are macros. Use them if
  7492.                       you wish to check what attributes to use (underline
  7493.                       or red?) and use the adapter functions (isEGA,
  7494.                       etc.) for adapter specific tests.
  7495.   
  7496.   Return value        these functions return TRUE if the video adapter or
  7497.                       type, as the case may be, is present. Otherwise
  7498.                       they return FALSE.
  7499.   
  7500.   See also            video.h
  7501.   
  7502.   Example             #include <video.h>
  7503.   
  7504.                       main()
  7505.                       {
  7506.                            if (ismono())            /* monochrome */
  7507.                                 if (isHerc())
  7508.                                      printf("Hercules");
  7509.                                 else
  7510.                                      printf("MDA");
  7511.                            else                /* color */
  7512.                                 if (isEGA())
  7513.                                      printf("EGA");
  7514.                                 else
  7515.                                      printf("CGA");
  7516.                       }
  7517.   
  7518.   
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.      TCHK 2.0                                               Page 114
  7532.  
  7533.   
  7534.   Function             isdir - is a FAT entry a subdirectory
  7535.   
  7536.   Syntax              boolean isdir(char *fspec);
  7537.   
  7538.   Prototype in        filehk.h
  7539.   
  7540.   Remarks             checks if a FAT entry is a valid subdirectory. The
  7541.                       string fspec should be in the following format:
  7542.   
  7543.                            [d:][path]filename.ext[\]
  7544.   
  7545.                       where
  7546.   
  7547.                            d: = optional drive letter
  7548.                            path = optional path
  7549.                            filename.ext = the name of the FAT entry you
  7550.                                           want to check
  7551.                       fspec may optionally have a \ at the end
  7552.   
  7553.                       Wildcards (*,?) are NOT supported and always cause
  7554.                       isdir to return FALSE.
  7555.   
  7556.                       This function does not harm the dta. The dta is
  7557.                       modified by this function, but restored before
  7558.                       returning.
  7559.   
  7560.   Return value        returns TRUE if fspec is a subdirectory, FALSE if
  7561.                       fspec does not exist or is not a subdirectory.
  7562.   
  7563.   Example             #include <filehk.h>
  7564.   
  7565.                       main()
  7566.                       {
  7567.                            char dirname[] = "a:\util\";
  7568.   
  7569.                            printf("%s is ",dirname);
  7570.                            if (! isdir())
  7571.                                 printf("not ");
  7572.                            printf("a subdirectory\n");
  7573.                       }
  7574.   
  7575.  
  7576.  
  7577.  
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.      TCHK 2.0                                               Page 115
  7598.  
  7599.   
  7600.   Function             isEMSavail - is EMS available
  7601.   
  7602.   Syntax              boolean isEMSavail(void);
  7603.   
  7604.   Prototype in        ibm.h
  7605.   
  7606.   Remarks             checks if EMS is installed.
  7607.   
  7608.   Return value        returns TRUE if EMS is present, otherwise FALSE.
  7609.   
  7610.   See also            ibm.h
  7611.                       EMMversion(), getEMSstatus(), EMSinfo(),
  7612.                       EMSpages(), EMSwarmbootprep()
  7613.   
  7614.   Example             #include <ibm.h>
  7615.   
  7616.                       main()
  7617.                       {
  7618.                            printf("EMS is ");
  7619.                            if (! isEMSavail())
  7620.                                 printf("not ");
  7621.                            printf("available\n");
  7622.                       }
  7623.   
  7624.   
  7625.  
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.  
  7663.      TCHK 2.0                                               Page 116
  7664.  
  7665.   
  7666.   Function             isExtended - is Extended memory installed
  7667.   
  7668.   Syntax              boolean isExtended(void);
  7669.   
  7670.   Prototype in        ibm.h
  7671.   
  7672.   Remarks             checks if Extended memory is installed.
  7673.   
  7674.   Return value        returns TRUE if Extended memory is installed, FALSE
  7675.                       otherwise.
  7676.   
  7677.   See also            Extendedtotal()
  7678.   
  7679.   Example             #include <ibm.h>
  7680.   
  7681.                       main()
  7682.                       {
  7683.                            printf("Extended memory is ");
  7684.                            if (! isExtended())
  7685.                                 printf("not ");
  7686.                            printf("installed\n");
  7687.                       }
  7688.   
  7689.  
  7690.  
  7691.  
  7692.  
  7693.  
  7694.  
  7695.  
  7696.  
  7697.  
  7698.  
  7699.  
  7700.  
  7701.  
  7702.  
  7703.  
  7704.  
  7705.  
  7706.  
  7707.  
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713.  
  7714.  
  7715.  
  7716.  
  7717.  
  7718.  
  7719.  
  7720.  
  7721.  
  7722.  
  7723.  
  7724.  
  7725.  
  7726.  
  7727.  
  7728.  
  7729.      TCHK 2.0                                               Page 117
  7730.  
  7731.   
  7732.   Function             isgameport - is a game port installed
  7733.   
  7734.   Syntax              boolean isgameport(void);
  7735.   
  7736.   Prototype in        ibm.h
  7737.   
  7738.   Remarks             checks if a game port is installed.
  7739.   
  7740.   Return value        returns TRUE if a game port is installed, FALSE
  7741.                       otherwise.
  7742.   
  7743.   Example             #include <ibm.h>
  7744.   
  7745.                       main()
  7746.                       {
  7747.                            printf("Game port is ");
  7748.                            if (! isgameport())
  7749.                                 printf("not ");
  7750.                            printf("installed\n");
  7751.                       }
  7752.   
  7753.  
  7754.  
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.  
  7773.  
  7774.  
  7775.  
  7776.  
  7777.  
  7778.  
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784.  
  7785.  
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.      TCHK 2.0                                               Page 118
  7796.  
  7797.   
  7798.   Function             isgn - sign of an integer
  7799.   
  7800.   Syntax              #include <mathhk.h>
  7801.                       (int) isgn(x)
  7802.   
  7803.   Prototype in        mathhk.h
  7804.   
  7805.   Remarks             isgn will determine the sign of x. Zero is
  7806.                       considered positive.
  7807.   
  7808.                       This function is a macro.
  7809.   
  7810.                       The macros sgn() and sign() are defined as isgn().
  7811.   
  7812.   Return value        returns -1 if x is negative, otherwise 1.
  7813.   
  7814.   See also            fsgn(), lsgn()
  7815.   
  7816.   
  7817.  
  7818.  
  7819.  
  7820.  
  7821.  
  7822.  
  7823.  
  7824.  
  7825.  
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840.  
  7841.  
  7842.  
  7843.  
  7844.  
  7845.  
  7846.  
  7847.  
  7848.  
  7849.  
  7850.  
  7851.  
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.      TCHK 2.0                                               Page 119
  7862.  
  7863.   
  7864.   Function             iskey102 - is an enhanced keyboard installed
  7865.   
  7866.   Syntax              boolean iskey102(void);
  7867.   
  7868.   Prototype in        ibm.h
  7869.   
  7870.   Remarks             checks if the keyboard is enhanced (102 keys or 101
  7871.                       in Europe). Does your keyboard have F11 and F12? If
  7872.                       so, it's an enhanced keyboard.
  7873.   
  7874.   Return value        returns TRUE if an enhanced keyboard is installed,
  7875.                       FALSE otherwise.
  7876.   
  7877.   Example             #include <ibm.h>
  7878.   
  7879.                       main()
  7880.                       {
  7881.                            printf("Keyboard is ");
  7882.                            if (iskey102())
  7883.                                 printf("enhanced\n");
  7884.                            else
  7885.                                 printf("old style (85 keys)\n");
  7886.                       }
  7887.   
  7888.  
  7889.  
  7890.  
  7891.  
  7892.  
  7893.  
  7894.  
  7895.  
  7896.  
  7897.  
  7898.  
  7899.  
  7900.  
  7901.  
  7902.  
  7903.  
  7904.  
  7905.  
  7906.  
  7907.  
  7908.  
  7909.  
  7910.  
  7911.  
  7912.  
  7913.  
  7914.  
  7915.  
  7916.  
  7917.  
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.      TCHK 2.0                                               Page 120
  7928.  
  7929.   
  7930.   Function             isleapyear - is a year a leap year
  7931.   
  7932.   Syntax              boolean isleapyear(int checkyear);
  7933.   
  7934.   Prototype in        datehk.h       (isleapyear)
  7935.   
  7936.   Remarks             checks if checkyear is a leap year (29 days in
  7937.                       February.)
  7938.   
  7939.   Return value        returns TRUE if checkyear is a leap year, FALSE
  7940.                       otherwise.
  7941.   
  7942.   See also            valid_date()
  7943.   
  7944.   Example             #include <datehk.h>
  7945.   
  7946.                       main()
  7947.                       {
  7948.                            int year;
  7949.   
  7950.                       /* assign some value to year */
  7951.                            printf("year %d is ",year);
  7952.                            if (! isleapyear(year))
  7953.                                 printf("not ");
  7954.                            printf("a leap year\n");
  7955.                       }
  7956.   
  7957.   
  7958.  
  7959.  
  7960.  
  7961.  
  7962.  
  7963.  
  7964.  
  7965.  
  7966.  
  7967.  
  7968.  
  7969.  
  7970.  
  7971.  
  7972.  
  7973.  
  7974.  
  7975.  
  7976.  
  7977.  
  7978.  
  7979.  
  7980.  
  7981.  
  7982.  
  7983.  
  7984.  
  7985.  
  7986.  
  7987.  
  7988.  
  7989.  
  7990.  
  7991.  
  7992.  
  7993.      TCHK 2.0                                               Page 121
  7994.  
  7995.   
  7996.   Function             isNetwork - is a network installed
  7997.   
  7998.   Syntax              boolean isNetwork(void);
  7999.   
  8000.   Prototype in        ibm.h
  8001.   
  8002.   Remarks             checks if a network is installed.
  8003.   
  8004.   Return value        returns TRUE if a network is installed, FALSE
  8005.                       otherwise.
  8006.   
  8007.   Note                this function requires DOS 3.1+
  8008.   
  8009.   Example             #include <ibm.h>
  8010.   
  8011.                       main()
  8012.                       {
  8013.                            printf("A network is ");
  8014.                            if (! isNetwork())
  8015.                                 printf("not ");
  8016.                            printf("installed\n");
  8017.                       }
  8018.   
  8019.  
  8020.  
  8021.  
  8022.  
  8023.  
  8024.  
  8025.  
  8026.  
  8027.  
  8028.  
  8029.  
  8030.  
  8031.  
  8032.  
  8033.  
  8034.  
  8035.  
  8036.  
  8037.  
  8038.  
  8039.  
  8040.  
  8041.  
  8042.  
  8043.  
  8044.  
  8045.  
  8046.  
  8047.  
  8048.  
  8049.  
  8050.  
  8051.  
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.  
  8058.  
  8059.      TCHK 2.0                                               Page 122
  8060.  
  8061.   
  8062.   Function             isPRINTavail - is PRINT.COM installed
  8063.   
  8064.   Syntax              int isPRINTavail(void);
  8065.   
  8066.   Prototype in        printhk.h
  8067.   
  8068.   Remarks             detects if PRINT.COM is installed.
  8069.   
  8070.   Return value        returns PRINT_ERROR if DOS 3.1 or greater is not
  8071.                       being used, otherwise returns PRINT_OK, PRINT_NOOK
  8072.                       or PRINT_INSTALLED, depending on the current
  8073.                       status.
  8074.   
  8075.   Note                requires DOS 3.1 or greater.
  8076.   
  8077.   See also            PRINTadd(), PRINThold(), PRINTpurge(),
  8078.                       PRINTremove(), PRINTresume
  8079.   
  8080.   
  8081.  
  8082.  
  8083.  
  8084.  
  8085.  
  8086.  
  8087.  
  8088.  
  8089.  
  8090.  
  8091.  
  8092.  
  8093.  
  8094.  
  8095.  
  8096.  
  8097.  
  8098.  
  8099.  
  8100.  
  8101.  
  8102.  
  8103.  
  8104.  
  8105.  
  8106.  
  8107.  
  8108.  
  8109.  
  8110.  
  8111.  
  8112.  
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.      TCHK 2.0                                               Page 123
  8126.  
  8127.   
  8128.   Function             isPM - the the hour AM or PM
  8129.   
  8130.   Syntax              #include <timehk.h>
  8131.                       (boolean) isPM(hr)
  8132.   
  8133.   Prototype in        timehk.h
  8134.   
  8135.   Remarks             determines if hr in 24-hour army time is AM or PM.
  8136.   
  8137.   Return value        returns TRUE if hr is noon (12) or later or FALSE
  8138.                       if hr is AM.
  8139.   
  8140.   See also            time_convert(), to24hour(), tohour()
  8141.   
  8142.   
  8143.  
  8144.  
  8145.  
  8146.  
  8147.  
  8148.  
  8149.  
  8150.  
  8151.  
  8152.  
  8153.  
  8154.  
  8155.  
  8156.  
  8157.  
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176.  
  8177.  
  8178.  
  8179.  
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190.  
  8191.      TCHK 2.0                                               Page 124
  8192.  
  8193.   
  8194.   Function             isShareavail - is SHARE installed
  8195.   
  8196.   Syntax              boolean isShareavail(void);
  8197.   
  8198.   Prototype in        doshk.h
  8199.   
  8200.   Remarks             checks if SHARE is installed.
  8201.   
  8202.   Return value        returns TRUE if SHARE is installed, FALSE
  8203.                       otherwise.
  8204.   
  8205.   See also            isAppendavail(), isAssignAvail()
  8206.   
  8207.   Example             #include <ibm.h>
  8208.   
  8209.                       main()
  8210.                       {
  8211.                            printf("SHARE is ");
  8212.                            if (! isShareavail())
  8213.                                 printf("not ");
  8214.                            printf("installed\n");
  8215.                       }
  8216.   
  8217.  
  8218.  
  8219.  
  8220.  
  8221.  
  8222.  
  8223.  
  8224.  
  8225.  
  8226.  
  8227.  
  8228.  
  8229.  
  8230.  
  8231.  
  8232.  
  8233.  
  8234.  
  8235.  
  8236.  
  8237.  
  8238.  
  8239.  
  8240.  
  8241.  
  8242.  
  8243.  
  8244.  
  8245.  
  8246.  
  8247.  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.  
  8253.  
  8254.  
  8255.  
  8256.  
  8257.      TCHK 2.0                                               Page 125
  8258.  
  8259.   
  8260.   Function             isVERIFYon - check VERIFY flag
  8261.   
  8262.   Syntax              #include <ibm.h>
  8263.                       isVERIFYon()
  8264.   
  8265.   Prototype in        ibm.h
  8266.   
  8267.   Remarks             checks the state of the verify flag. The VERIFY
  8268.                       status flag can be set from DOS by VERIFY ON or
  8269.                       VERIFY OFF.
  8270.   
  8271.                       This function is a macro.
  8272.   
  8273.   Return value        returns TRUE if the verify flag is on, FALSE if the
  8274.                       flag is off.
  8275.   
  8276.   See also            isBREAKon(), setBREAK(), setVERIFY()
  8277.   
  8278.   Example             #include <ibm.h>
  8279.   
  8280.                       main()
  8281.                       {
  8282.                            printf("VERIFY flag is ");
  8283.                            if (! isVERIFYon())
  8284.                                 printf("not ");
  8285.                            printf("on\n");
  8286.                       }
  8287.   
  8288.  
  8289.  
  8290.  
  8291.  
  8292.  
  8293.  
  8294.  
  8295.  
  8296.  
  8297.  
  8298.  
  8299.  
  8300.  
  8301.  
  8302.  
  8303.  
  8304.  
  8305.  
  8306.  
  8307.  
  8308.  
  8309.  
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.  
  8321.  
  8322.  
  8323.      TCHK 2.0                                               Page 126
  8324.  
  8325.   
  8326.   Function             isVidclock - is VIDCLOCK.COM by Tom Hanlin
  8327.                                      installed
  8328.   
  8329.   Syntax              boolean isVidclock(void);
  8330.   
  8331.   Prototype in        doshk.h
  8332.   
  8333.   Remarks             checks if VIDCLOCK.COM by Tom Hanlin is installed.
  8334.   
  8335.   Return value        returns TRUE if VIDCLOCK.COM is installed, FALSE
  8336.                       otherwise.
  8337.   
  8338.   Example             #include <ibm.h>
  8339.   
  8340.                       main()
  8341.                       {
  8342.                            printf("VidClock is ");
  8343.                            if (! isVidclock())
  8344.                                 printf("not ");
  8345.                            printf("installed\n");
  8346.                       }
  8347.   
  8348.  
  8349.  
  8350.  
  8351.  
  8352.  
  8353.  
  8354.  
  8355.  
  8356.  
  8357.  
  8358.  
  8359.  
  8360.  
  8361.  
  8362.  
  8363.  
  8364.  
  8365.  
  8366.  
  8367.  
  8368.  
  8369.  
  8370.  
  8371.  
  8372.  
  8373.  
  8374.  
  8375.  
  8376.  
  8377.  
  8378.  
  8379.  
  8380.  
  8381.  
  8382.  
  8383.  
  8384.  
  8385.  
  8386.  
  8387.  
  8388.  
  8389.      TCHK 2.0                                               Page 127
  8390.  
  8391.   
  8392.   Function             Jul... - family of Julian date conversion
  8393.                                  functions
  8394.   
  8395.   Syntax              double JultoCal(double jul);
  8396.                       double JultoCalCent(double jul);
  8397.                       char *JultoGreg(double jul);
  8398.                       char *JultoGregEuro(double jul);
  8399.                       char *JultoGregJap(double jul);
  8400.                       struct ddate *Jultoddate(double jul);
  8401.   
  8402.                       double JulAtoCal(double jul);
  8403.                       double JulAtoCalCent(double jul);
  8404.                       char *JulAtoGreg(double jul);
  8405.                       char *JulAtoGregEuro(double jul);
  8406.                       char *JulAtoGregJap(double jul);
  8407.                       struct ddate *JulAtoddate(double jul);
  8408.   
  8409.                       double JulBtoCal(double jul);
  8410.                       double JulBtoCalCent(double jul);
  8411.                       char *JulBtoGreg(double jul);
  8412.                       char *JulBtoGregEuro(double jul);
  8413.                       char *JulBtoGregJap(double jul);
  8414.                       struct ddate *JulBtoddate(double jul);
  8415.   
  8416.   Prototype in        datehk.h
  8417.   
  8418.   Remarks             Jul.toCal      converts a Julian date to Calendar
  8419.                                      date
  8420.                       Jul.toCalCent  converts a Julian date to Calendar
  8421.                                      date (w/century)
  8422.                       Jul.toGreg...  converts a Julian date to the
  8423.                                      appropraite Gregorian date
  8424.                       Jul.toddate    converts a Julian date to struct
  8425.                                      ddate
  8426.   
  8427.   Return value        Jul.toCal return a Calendar date
  8428.                       Jul.toCalCent return a Calendar date (w/century)
  8429.                       Jul.toGreg.. return the appropriate Gregorian date
  8430.                       Jul.toddate return a struct ddate
  8431.   
  8432.   See also            Appendix A
  8433.                       Cal...(), date_convert(), ddatetofull(),
  8434.                       ddatetoshort(), ddatetostr(), fulltoddate(),
  8435.                       Greg...(), monthexpand(), shorttoddate(),
  8436.                       strtoddate()
  8437.   
  8438.   Example             see demodate.c
  8439.   
  8440.  
  8441.  
  8442.  
  8443.  
  8444.  
  8445.  
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.      TCHK 2.0                                               Page 128
  8456.  
  8457.   
  8458.   Function             leftstr - return the left portion of a string
  8459.   
  8460.   Syntax              char *leftstr(char *source, int len);
  8461.   
  8462.   Prototype in        stringhk.h
  8463.   
  8464.   Remarks             leftstr performs just like its BASIC counterpart
  8465.                       LEFT$().
  8466.   
  8467.                       leftstr returns the left part of a string.
  8468.   
  8469.   Return value        leftstr returns the leftmost len characters of
  8470.                       source. If the length of source is less than len,
  8471.                       the entire string is returned.
  8472.   
  8473.                       leftstr returns a pointer to the storage location
  8474.                       containing the new string, or NULL if space could
  8475.                       not be allocated.
  8476.   
  8477.   See also            midstr(), rightstr()
  8478.   
  8479.   Example             #include <stringhk.h>
  8480.                       #include <stdio.h>            /* for the printf */
  8481.   
  8482.                       main()
  8483.                       {
  8484.                            char msg[25], *l;
  8485.   
  8486.                            strcpy(msg,"This is another test");
  8487.                            l = leftstr(msg,7);
  8488.                            printf("%s\n",msg);
  8489.                            printf("%s\n",l);
  8490.                       }
  8491.   
  8492.   Program output      This is another test
  8493.                       This an
  8494.   
  8495.   
  8496.  
  8497.  
  8498.  
  8499.  
  8500.  
  8501.  
  8502.  
  8503.  
  8504.  
  8505.  
  8506.  
  8507.  
  8508.  
  8509.  
  8510.  
  8511.  
  8512.  
  8513.  
  8514.  
  8515.  
  8516.  
  8517.  
  8518.  
  8519.  
  8520.  
  8521.      TCHK 2.0                                               Page 129
  8522.  
  8523.   
  8524.   Function             litebar_alloc - allocate memory for a litebar
  8525.                                         menu
  8526.   
  8527.   Syntax              struct litebar_header *litebar_alloc(int left, int
  8528.                                 top, int right, int bottom, char *frame,
  8529.                                 char *title, int titlejustify, int count,
  8530.                                 char *command[], int cmdleft[], int
  8531.                                 cmdright[], int cmdup[], int cmddown[],
  8532.                                 int cmdkey[], char cmdflag[], int cmdx[],
  8533.                                 int cmdy[], char *message[], int msgx,
  8534.                                 int msgy, int argq, int quitkey[], int
  8535.                                 colframe, int coltitle, int colnorm, int
  8536.                                 colcmdkey, int colhilite, int coldisable,
  8537.                                 int coldishilite, int colnotopt, int
  8538.                                 colmessage, int defaultcommand, unsigned
  8539.                                 flags);
  8540.   
  8541.   Prototype in        menuhk.h
  8542.   
  8543.   Remarks             litebar_alloc creates a litebar menu with the
  8544.                       following information:
  8545.   
  8546.                       Coordinates of the frame of the litebar menu are
  8547.                       (left,top) to (right,bottom), the border, if any,
  8548.                       is made up of the 9 or 11 chars in frame (0 to 8 or
  8549.                       10) as per boxwindow(), with an optional title on
  8550.                       the top edge of the menu border, justified left,
  8551.                       right or center (see howard.h for more details). If
  8552.                       frame == NULL  there will be no border. If
  8553.                       titlejustify = NONE there will be no title, or
  8554.                       pre-/post-title separators.
  8555.   
  8556.                       Unlike the popup menus, a count parameter is
  8557.                       required, specifiying how many commands there are.
  8558.                       The command array is a list of strings or text to
  8559.                       be displayed on the screen.
  8560.   
  8561.                       The cmdleft, cmdright, cmdup and cmddown parameters
  8562.                       are lists of where the respective key will move the
  8563.                       hilite bar. These values should correspond to an
  8564.                       index of the command[], with the exception noted
  8565.                       below. For example, if the hilite bar is on
  8566.                       command[0] and you wish the right arrow to move to
  8567.                       command[10], then cmdright[0] = 10. The exception
  8568.                       is when an arrow is to be disabled. Specifying a -1
  8569.                       as a direction element will disable that direction
  8570.                       for that command (i.e. at command[0] to make the
  8571.                       left arrow do nothing, then cmdleft[0] = -1.)
  8572.   
  8573.                       Each command can have a hotkey associated with it,
  8574.                       denoted by the appropriate cmdkey[]. The 'hotkey'
  8575.                       is actually a one-touch key, instantly moving to
  8576.                       and selecting a choice. The cmdkey value is an 
  8577.  
  8578.  
  8579.  
  8580.  
  8581.  
  8582.  
  8583.  
  8584.  
  8585.  
  8586.  
  8587.      TCHK 2.0                                               Page 130
  8588.  
  8589.                       offset into the command string. For example, a
  8590.                       command "Edit" with a hotkey of the "E" would have
  8591.                       a cmdkey value of 0 (an offset from the beginning
  8592.                       of the command). A command without a hotkey has a
  8593.                       cmdkey value of -1.
  8594.   
  8595.                       Each command has an appropriate cmdflag field. A
  8596.                       command may be either:
  8597.   
  8598.                            ENABLED     - a valid choice
  8599.                            DISABLED    - displayed, but not selectable
  8600.                            NOTOPTION   - not a command (static text)
  8601.   
  8602.                       These are defined in menuhk.h. Other values may
  8603.                       cause unpredictable results.
  8604.   
  8605.                       The cmdx and cmdy arrays are lists of where the
  8606.                       commands should be displayed, respective to the
  8607.                       box. This is in a 'windowing' sense. If the box
  8608.                       coordinates are (10,10) to (20,20) and you wish
  8609.                       something to appear at the physical coordinates
  8610.                       (12,10) then (cmdx,cmdy) for the proper command
  8611.                       should be (2,0). This is an exception to the normal
  8612.                       coordinate system beginning at (1,1). In a litebar
  8613.                       menu, the 'border' is not excluded from the display
  8614.                       output and can be written over (this is true
  8615.                       regardless of whether or not a frame is displayed.)
  8616.   
  8617.                       TCHK litebar menus can display a message for each
  8618.                       command as it is hilited, much like Lotus style
  8619.                       menus. This message is optional, and if the
  8620.                       appropriate message[] is not NULL, it will be
  8621.                       displayed at (msgx,msgy). If the message[] element
  8622.                       is NULL, no message will be displayed. These
  8623.                       coordinates are relative to the menu coordinates,
  8624.                       just as cmdx and cmdy are.
  8625.   
  8626.                       A list of key codes that cause immediate return of
  8627.                       the user selection of the menu are in the quitkey
  8628.                       list, consisting of argq elements.
  8629.   
  8630.                       The following colors are used:
  8631.   
  8632.                            colframe       - frame around menu (if any)
  8633.                            coltitle       - title (if any)
  8634.                            colnorm        - enabled commands
  8635.                            colcmdkey      - hotkey in command
  8636.                            colhilite      - currently hilited option
  8637.                            coldisable     - disabled options
  8638.                            coldishilite   - disabled and currently
  8639.                                             hilited
  8640.                            colnotopt      - static text (NOTOPTION)
  8641.                            colmessage     - message (if any)
  8642.   
  8643.   
  8644.  
  8645.  
  8646.  
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653.      TCHK 2.0                                               Page 131
  8654.  
  8655.                       defaultcommand is the command initially hilited. If
  8656.                       an invalid command is chosen (the command is static
  8657.                       text, or does not exist, etc.) the first valid
  8658.                       command is the default.
  8659.   
  8660.                       flags is a 2-byte bit field of flags
  8661.   
  8662.                            QEFxxxxH xxIRCEDW
  8663.   
  8664.                       where
  8665.   
  8666.                            Q = Quit after selection
  8667.                            E = ESC means quit
  8668.                            F = Free memory on quit
  8669.                            H = Hierarchial menu (not implemented yet)
  8670.                            I = cmdkeys are case Independent
  8671.                            R = Restore cursor before returning
  8672.                            C = don't hide Cursor
  8673.                            E = Erase menu on free/cleanup
  8674.                            D = Disabled off (can be selected)
  8675.                            W = Wraparound
  8676.   
  8677.                       Briefly, Quit will restore the display to the state
  8678.                       it was in before the litebar menu was called
  8679.                       (settextinfo(), etc.). With E, if ESC is pressed
  8680.                       the menu is removed, for any other selection no
  8681.                       cleanup is done (unless Q is specified). Free
  8682.                       memory on quit calls litebar_free() after a
  8683.                       selection is made. Hierarchial menus are not
  8684.                       implemented yet. Keys are input via inkey() or
  8685.                       inkeyc(), depending on case Independency. When
  8686.                       litebar_get() is called, the cursor is hidden
  8687.                       unless C is given. The cursor is unhidden only if R
  8688.                       is given. E will cause the menu to be erased from
  8689.                       the screen if quitting. Disabled commands are not
  8690.                       normally selectable, unless D is on. Wraparound
  8691.                       allows the selecting hilite bar to wrap over the
  8692.                       top and under the bottom.
  8693.   
  8694.   
  8695.   Return value        allocates and returns a pointer to a litebar header
  8696.                       structure if the menu was successfully created,
  8697.                       otherwise returns NULL if an error occurred.
  8698.                       litebarerrno will have the following values:
  8699.   
  8700.                            0    success
  8701.                            1    error, could not allocate litebar header
  8702.                            2    error, could not allocate videosave
  8703.                            3    error, could not allocate menusave
  8704.                            4    error, invalid title justification
  8705.                            5    error, could not allocate popup field
  8706.                            7    error, no menu item enabled (no commands)
  8707.                            8    error, could not allocate quit keylist
  8708.   
  8709.   
  8710.  
  8711.  
  8712.  
  8713.  
  8714.  
  8715.  
  8716.  
  8717.  
  8718.  
  8719.      TCHK 2.0                                               Page 132
  8720.  
  8721.   Note                The litebar_header structure contains important
  8722.                       information about the menu, including pointers to
  8723.                       linked lists for the fields, saved video displays,
  8724.                       etc. I strongly advise that you don't even think of
  8725.                       modifying this information yourself. Let the
  8726.                       litebar...() functions handle it for you. These
  8727.                       functions have been developed and used over a
  8728.                       period of several months, programs and conditions
  8729.                       which proves them to be vitually bug free. If you
  8730.                       really want to mess with them yourself, feel free.
  8731.                       But I certainly wouldn't want to attempt it.
  8732.                       Modifying these functions even with the srource
  8733.                       code is a headache.
  8734.   
  8735.   See also            menuhk.h
  8736.                       changelitebar(), litebar_free(), litebar_get(),
  8737.                       litehilite(), litemessage(), liteunlite()
  8738.                       litebarerrno
  8739.   
  8740.   Example             see demolite.c
  8741.   
  8742.   
  8743.  
  8744.  
  8745.  
  8746.  
  8747.  
  8748.  
  8749.  
  8750.  
  8751.  
  8752.  
  8753.  
  8754.  
  8755.  
  8756.  
  8757.  
  8758.  
  8759.  
  8760.  
  8761.  
  8762.  
  8763.  
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769.  
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.  
  8778.  
  8779.  
  8780.  
  8781.  
  8782.  
  8783.  
  8784.  
  8785.      TCHK 2.0                                               Page 133
  8786.  
  8787.   
  8788.   Function             litebar_free - frees memory allocated by a
  8789.                                        litebar menu
  8790.   
  8791.   Syntax              void litebar_free(struct litebar_header *lh);
  8792.   
  8793.   Prototype in        menuhk.h
  8794.   
  8795.   Remarks             frees all memory allocated to a litebar menu.
  8796.   
  8797.   Return value        nothing.
  8798.   
  8799.   Note                see litebar_alloc()
  8800.   
  8801.   See also            menuhk.h
  8802.                       changelitebar(), litebar_alloc(), litebar_get(),
  8803.                       litehilite(), litemessage(), liteunlite()
  8804.                       litebarerrno
  8805.   
  8806.   Example             see demolite.c
  8807.   
  8808.   
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819.  
  8820.  
  8821.  
  8822.  
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837.  
  8838.  
  8839.  
  8840.  
  8841.  
  8842.  
  8843.  
  8844.  
  8845.  
  8846.  
  8847.  
  8848.  
  8849.  
  8850.  
  8851.      TCHK 2.0                                               Page 134
  8852.  
  8853.   
  8854.   Function             litebar_get - get user's choice from a litebar
  8855.                                       menu
  8856.   
  8857.   Syntax              int litebar_get(struct litebar_header *lh);
  8858.   
  8859.   Prototype in        menuhk.h
  8860.   
  8861.   Remarks             litebar_get does the actual prompting the user for
  8862.                       input. The following keys can be used to navigate
  8863.                       in the menu:
  8864.   
  8865.                            Up, Down,      Move select bar to another
  8866.                            Left, Right    command, as per parms to
  8867.                                           litebar_alloc(). See
  8868.                                           litebar_alloc() for more
  8869.                                           details.
  8870.                            ENTER          Select the hilited option
  8871.                            ESC            Abort
  8872.   
  8873.                       in addition to any cmdkeys and quitkeys.
  8874.   
  8875.                       Other actions may be taken before returning from
  8876.                       this function, according to the flags for the menu.
  8877.                       See litebar_alloc() for more details.
  8878.   
  8879.   Return value        returns zero if ESC was hit. If an command was
  8880.                       chosen, litebar_get() returns the number of the
  8881.                       command selected. This is not the array index of
  8882.                       the command. If command[] has 3 static text items
  8883.                       and a command, and the command is selected, a 1
  8884.                       will be returned, even though the command is the
  8885.                       fourth command with a command index of three
  8886.                       (command[3]). If a quitkey was hit, the return
  8887.                       value will be the key code for the quitkey, plus
  8888.                       1000 (i.e. Ctrl-Z, key code 26, as a quitkey will
  8889.                       return 1026 when it is hit.)
  8890.   
  8891.   See also            menuhk.h
  8892.                       changelitebar(), litebar_alloc(), litebar_free(),
  8893.                       litehilite(), litemessage(), liteunlite()
  8894.                       litebarerrno
  8895.   
  8896.   Example             demolite.c
  8897.   
  8898.   
  8899.  
  8900.  
  8901.  
  8902.  
  8903.  
  8904.  
  8905.  
  8906.  
  8907.  
  8908.  
  8909.  
  8910.  
  8911.  
  8912.  
  8913.  
  8914.  
  8915.  
  8916.  
  8917.      TCHK 2.0                                               Page 135
  8918.  
  8919.   
  8920.   Function             litehilite - hilite a litebar menu command
  8921.   
  8922.   Syntax              void litehilite(struct litebar_header *lh);
  8923.   
  8924.   Prototype in        menuhk.h
  8925.   
  8926.   Remarks             displays a litebar menu command in the hilited
  8927.                       color via Borland's console i/o.
  8928.   
  8929.                       This function is used internally by several
  8930.                       litebar...() menu functions.
  8931.   
  8932.   Return value        nothing.
  8933.   
  8934.   Note                This function is for internal uses only.
  8935.   
  8936.   See also            menuhk.h
  8937.                       changelitebar(), litebar_alloc(), litebar_free(),
  8938.                       litebar_get(), litemessage(), liteunlite()
  8939.                       litebarerrno
  8940.   
  8941.   
  8942.  
  8943.  
  8944.  
  8945.  
  8946.  
  8947.  
  8948.  
  8949.  
  8950.  
  8951.  
  8952.  
  8953.  
  8954.  
  8955.  
  8956.  
  8957.  
  8958.  
  8959.  
  8960.  
  8961.  
  8962.  
  8963.  
  8964.  
  8965.  
  8966.  
  8967.  
  8968.  
  8969.  
  8970.  
  8971.  
  8972.  
  8973.  
  8974.  
  8975.  
  8976.  
  8977.  
  8978.  
  8979.  
  8980.  
  8981.  
  8982.  
  8983.      TCHK 2.0                                               Page 136
  8984.  
  8985.   
  8986.   Function             litemessage - change the message for a litebar
  8987.                                       menu
  8988.   
  8989.   Syntax              void litemessage(struct litebar_header *lh,
  8990.                                        int len);
  8991.   
  8992.   Prototype in        menuhk.h
  8993.   
  8994.   Remarks             changes the message for a litebar menu.
  8995.   
  8996.                       This function is used internally by several
  8997.                       litebar...() menu functions.
  8998.   
  8999.   Return value        nothing.
  9000.   
  9001.   Note                This function is for internal uses only.
  9002.   
  9003.   See also            menuhk.h
  9004.                       changelitebar(), litebar_alloc(), litebar_free(),
  9005.                       litebar_get(), litehilite(), liteunlite()
  9006.                       litebarerrno
  9007.   
  9008.   
  9009.  
  9010.  
  9011.  
  9012.  
  9013.  
  9014.  
  9015.  
  9016.  
  9017.  
  9018.  
  9019.  
  9020.  
  9021.  
  9022.  
  9023.  
  9024.  
  9025.  
  9026.  
  9027.  
  9028.  
  9029.  
  9030.  
  9031.  
  9032.  
  9033.  
  9034.  
  9035.  
  9036.  
  9037.  
  9038.  
  9039.  
  9040.  
  9041.  
  9042.  
  9043.  
  9044.  
  9045.  
  9046.  
  9047.  
  9048.  
  9049.      TCHK 2.0                                               Page 137
  9050.  
  9051.   
  9052.   Function             liteunlite - unhilite a litebar menu command
  9053.   
  9054.   Syntax              void liteunlite(struct litebar_header *lh);
  9055.   
  9056.   Prototype in        menuhk.h
  9057.   
  9058.   Remarks             displays a litebar menu command in its unhilited
  9059.                       color(s).
  9060.   
  9061.                       This function is used internally by several
  9062.                       litebar...() menu functions.
  9063.   
  9064.   Return value        nothing.
  9065.   
  9066.   Note                This function is for internal uses only.
  9067.   
  9068.   See also            menuhk.h
  9069.                       changelitebar(), litebar_alloc(), litebar_free(),
  9070.                       litebar_get(), litehilite(), litemessage()
  9071.                       litebarerrno
  9072.   
  9073.   
  9074.  
  9075.  
  9076.  
  9077.  
  9078.  
  9079.  
  9080.  
  9081.  
  9082.  
  9083.  
  9084.  
  9085.  
  9086.  
  9087.  
  9088.  
  9089.  
  9090.  
  9091.  
  9092.  
  9093.  
  9094.  
  9095.  
  9096.  
  9097.  
  9098.  
  9099.  
  9100.  
  9101.  
  9102.  
  9103.  
  9104.  
  9105.  
  9106.  
  9107.  
  9108.  
  9109.  
  9110.  
  9111.  
  9112.  
  9113.  
  9114.  
  9115.      TCHK 2.0                                               Page 138
  9116.  
  9117.   
  9118.   Function             lsgn - sign of a long integer
  9119.   
  9120.   Syntax              #include <mathhk.h>
  9121.                       (int) lsgn(x)
  9122.   
  9123.   Prototype in        mathhk.h
  9124.   
  9125.   Remarks             lsgn will determine the sign of x. Zero is
  9126.                       considered positive.
  9127.   
  9128.                       This function is a macro.
  9129.   
  9130.                       The macro lsign() is defined as lsgn().
  9131.   
  9132.   Return value        returns -1 if x is negative, otherwise 1.
  9133.   
  9134.   See also            fsgn(), isgn()
  9135.   
  9136.   
  9137.  
  9138.  
  9139.  
  9140.  
  9141.  
  9142.  
  9143.  
  9144.  
  9145.  
  9146.  
  9147.  
  9148.  
  9149.  
  9150.  
  9151.  
  9152.  
  9153.  
  9154.  
  9155.  
  9156.  
  9157.  
  9158.  
  9159.  
  9160.  
  9161.  
  9162.  
  9163.  
  9164.  
  9165.  
  9166.  
  9167.  
  9168.  
  9169.  
  9170.  
  9171.  
  9172.  
  9173.  
  9174.  
  9175.  
  9176.  
  9177.  
  9178.  
  9179.  
  9180.  
  9181.      TCHK 2.0                                               Page 139
  9182.  
  9183.   
  9184.   Function             ltrim - trims leading blanks
  9185.   
  9186.   Syntax              char *ltrim(char *source);
  9187.   
  9188.   Prototype in        stringhk.h
  9189.   
  9190.   Remarks             remove leading blanks in a string. The string
  9191.                       passed to ltrim (source) is modified.
  9192.   
  9193.   Return value        returns a pointer to source.
  9194.   
  9195.   Example             #include <stringhk.h>
  9196.                       #include <stdio.h>            /* for the printf */
  9197.   
  9198.                       main()
  9199.                       {
  9200.                            char msg[25] = "  Hello everyone   ";
  9201.   
  9202.                            printf("String [%s]\n",msg);
  9203.                            printf("ltrim  [%s]\n",ltrim(msg));
  9204.                       }
  9205.        
  9206.   Program output      String [  Hello everyone   ]
  9207.                       ltrim  [Hello everyone   ]
  9208.   
  9209.   
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.  
  9228.  
  9229.  
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.  
  9236.  
  9237.  
  9238.  
  9239.  
  9240.  
  9241.  
  9242.  
  9243.  
  9244.  
  9245.  
  9246.  
  9247.      TCHK 2.0                                               Page 140
  9248.  
  9249.   
  9250.   Function             lotus_setup - creates info for menu_lotus()
  9251.   
  9252.   Syntax              void lotus_setup(int argc, byte *command[],
  9253.                                 char cmdkey[], byte col[], byte
  9254.                                 *message[], byte msglen[]);
  9255.   
  9256.   Prototype in        menuhk.h
  9257.   
  9258.   Remarks             lotus_setup does a lot of the grunt work necessary
  9259.                       to use menu_lotus() properly. Given the command and
  9260.                       message lists this function will create cmdkey[],
  9261.                       col[] and msglen[].
  9262.   
  9263.   Return value        nothing.
  9264.   
  9265.   See also            litebar...(), menu_lotus(), popup...()
  9266.   
  9267.   Example             see demo.c
  9268.   
  9269.   
  9270.  
  9271.  
  9272.  
  9273.  
  9274.  
  9275.  
  9276.  
  9277.  
  9278.  
  9279.  
  9280.  
  9281.  
  9282.  
  9283.  
  9284.  
  9285.  
  9286.  
  9287.  
  9288.  
  9289.  
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296.  
  9297.  
  9298.  
  9299.  
  9300.  
  9301.  
  9302.  
  9303.  
  9304.  
  9305.  
  9306.  
  9307.  
  9308.  
  9309.  
  9310.  
  9311.  
  9312.  
  9313.      TCHK 2.0                                               Page 141
  9314.  
  9315.   
  9316.   Function             machine_id - determine machine type
  9317.   
  9318.   Syntax              int machine_id(void);
  9319.   
  9320.   Prototype in        ibm.h
  9321.   
  9322.   Remarks             identifies the machine by use of the ROM byte and
  9323.                       model byte (available through a DOS call.) 
  9324.   
  9325.   Return value        returns a code number depending on the machine
  9326.                       type. See ibm.h for more details.
  9327.   
  9328.   Note                This function cannot differentiate between a PS/2
  9329.                       Model 25 and PS/2 Model 30. However, the Model 30
  9330.                       has a hard drive, the Model 25 has none. For now
  9331.                       the Model 30 return code means the presence of a
  9332.                       Model 30 or a Model 25.
  9333.   
  9334.                       The PS/2 Model 70 cannot currently be identified
  9335.                       properly.
  9336.   
  9337.                       Also, the Portable PC cannot be 100% identified
  9338.                       through this function. Aside from the ROM byte
  9339.                       (which is identical to the XT) I don't know of any
  9340.                       distinguishing criteria. Anyone have ideas?
  9341.   
  9342.   See also            ibm.h
  9343.                       cpu_id(), ndp_id(), ROM_date(), ROM_id()
  9344.   
  9345.   Example             #include <ibm.h>
  9346.   
  9347.                       main()
  9348.                       {
  9349.                            printf("Machine ID() code = %d\n",
  9350.                                   machine_id());
  9351.                       }
  9352.   
  9353.   Program output      Machine ID code = 1      /* on my PC */
  9354.   
  9355.   
  9356.  
  9357.  
  9358.  
  9359.  
  9360.  
  9361.  
  9362.  
  9363.  
  9364.  
  9365.  
  9366.  
  9367.  
  9368.  
  9369.  
  9370.  
  9371.  
  9372.  
  9373.  
  9374.  
  9375.  
  9376.  
  9377.  
  9378.  
  9379.      TCHK 2.0                                               Page 142
  9380.  
  9381.   
  9382.   Function             memory_strategy - get/set memory alloc strategy
  9383.   
  9384.   Syntax              int memory_strategy(boolean read, int *strategy);
  9385.   
  9386.   Prototype in        ibm.h
  9387.   
  9388.   Remarks             this function will get or set the memory allocation
  9389.                       strategy. The variable read determines whether the
  9390.                       function will read or write (get or set) the
  9391.                       strategy value stored at *strategy.
  9392.   
  9393.   Return value        returns zero if successful (and *strategy is the
  9394.                       strategy being used) or, if an error occurs, the
  9395.                       error code (in which case the value in *strategy is
  9396.                       meaningless.)
  9397.   
  9398.   Note                this function requires DOS 3.xx.
  9399.   
  9400.   See also            ibm.h
  9401.   
  9402.   Example             #include <ibm.h>
  9403.   
  9404.                       #define GET TRUE         /* read */
  9405.                       #define SET FALSE        /* write */
  9406.   
  9407.                       main()
  9408.                       {
  9409.                            int memstrat;
  9410.   
  9411.                            if (memory_strategy(GET,&memstrat) !=
  9412.                                      MEM_STRAT_BEST)
  9413.                                 memory_strategy(SET,MEM_STRAT_BEST);
  9414.                       }
  9415.        /* Bad, no error checking done. When you document
  9416.           100+ functions, you write the best code, don't you? */
  9417.   
  9418.  
  9419.  
  9420.  
  9421.  
  9422.  
  9423.  
  9424.  
  9425.  
  9426.  
  9427.  
  9428.  
  9429.  
  9430.  
  9431.  
  9432.  
  9433.  
  9434.  
  9435.  
  9436.  
  9437.  
  9438.  
  9439.  
  9440.  
  9441.  
  9442.  
  9443.  
  9444.  
  9445.      TCHK 2.0                                               Page 143
  9446.  
  9447.   
  9448.   Function             menu_lotus - Lotus style menu
  9449.   
  9450.   Syntax              char menu_lotus(int argc, char cmdkey[],
  9451.                                      int *command[], int col[], int
  9452.                                      *message[], int msglen[], int
  9453.                                      normal, int highlite, int cmdrow,
  9454.                                      boolean clockon, int clockrow, int
  9455.                                      clockcol, int clockcolor);
  9456.   
  9457.   Prototype in        menuhk.h
  9458.   
  9459.   Remarks             menu_lotus displays a Lotus style 'slash bar' menu
  9460.                       and waits for a menu selection. This function is
  9461.                       modeled after the slash bar menu in Symphony. The
  9462.                       function parameters are:
  9463.   
  9464.                            argc           number of menu choices
  9465.                            cmdkey         array of the 1st letter of each
  9466.                                           command (must be capitalized)
  9467.                            command        menu choices
  9468.                            col            columns of 1st letters of menu
  9469.                                           commands (for displaying
  9470.                                           command line)
  9471.                            message        respective messages for menu
  9472.                                           commands
  9473.                            msglen         lengths of messages
  9474.                            normal         color of text
  9475.                            highlite       color of highlited option
  9476.                            cmdrow         row to display command line on
  9477.                            clockon        flag: display a clock?
  9478.                            clockrow       row coordinate of clock
  9479.                            clockcol       column coordinate of clock
  9480.                            clockcolor     color of clock
  9481.   
  9482.                       menu_lotus will display an optional clock (clockon
  9483.                       = TRUE) that is updated every minute. The clock is
  9484.                       displayed as 11:44 PM.
  9485.   
  9486.                       All elements of cmdkey[] MUST be capitalized.
  9487.   
  9488.                       menu_lotus provides limited cursor control, as per
  9489.                       Symphony:
  9490.   
  9491.                            Up Arrow       \ move hilite left 1 choice
  9492.                            Left Arrow     /
  9493.                            Down Arrow     \ move hilite right 1 choice
  9494.                            Right Arrow    /
  9495.                            Home           hilites first command
  9496.                            End            hilites last command
  9497.                            Enter          selects hilited menu choice
  9498.                            ESC            selects nothing. Returns ESC
  9499.                                           code
  9500.   
  9501.   
  9502.  
  9503.  
  9504.  
  9505.  
  9506.  
  9507.  
  9508.  
  9509.  
  9510.  
  9511.      TCHK 2.0                                               Page 144
  9512.  
  9513.                       The cursor keys do not wraparound. Pressing right
  9514.                       arrow at the last menu choice does nothing.
  9515.   
  9516.                       All output is done via Borland's console i/o.
  9517.   
  9518.   Return value        returns the upper of the 1st letter of the menu
  9519.                       choice selected, or ESC (0x27) if ESC was pressed
  9520.   
  9521.   Note                This function is currently being rewritten to
  9522.                       conform more closely code- and option- wise with
  9523.                       the other menu functions (popup and litebar menus).
  9524.                       The final form will be similar to the litebar
  9525.                       menus, but with extra (and less) features to
  9526.                       conform with the Lotus style of menus (Symphony and
  9527.                       1-2-3 have similar, but different menu
  9528.                       manipulations). I guarrantee the revised version
  9529.                       will be worth the effort to rewrite your calls.
  9530.   
  9531.                       Currently, menu_lotus() does not work (unless you
  9532.                       want to crash your machine, in which case it does
  9533.                       the job fine.) See the note in the Revision
  9534.                       section.
  9535.   
  9536.   See also            litebar...(), lotus_setup(), popup...()
  9537.   
  9538.   Example             see testmenu.c
  9539.   
  9540.   
  9541.  
  9542.  
  9543.  
  9544.  
  9545.  
  9546.  
  9547.  
  9548.  
  9549.  
  9550.  
  9551.  
  9552.  
  9553.  
  9554.  
  9555.  
  9556.  
  9557.  
  9558.  
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575.  
  9576.  
  9577.      TCHK 2.0                                               Page 145
  9578.  
  9579.   
  9580.   Function             menu_popup - popup style menu
  9581.   
  9582.   Syntax              int menu_popup(int left, int top, int right, int
  9583.                                      bottom, char frame[], char *title,
  9584.                                      int titlejustify, char *command[],
  9585.                                      int cmdkey[], char cmdflag[], int
  9586.                                      colframe, int coltitle, int colnorm,
  9587.                                      int colcmdkey, int colhilite, int
  9588.                                      coldisable, int coldishilite, int
  9589.                                      colnotopt, int defaultcommand,
  9590.                                      unsigned flags);
  9591.   
  9592.   Prototype in        menuhk.h
  9593.   
  9594.   Remarks             an all-in-one function, menu_popup() is equivalent
  9595.                       to calling popup_alloc(), popup_get() and
  9596.                       popup_free(), with the flags Quit, Erase menu, case
  9597.                       Independent and Wraparound. See popup_alloc() and
  9598.                       popup_get for more details about parameters and
  9599.                       menu keys.
  9600.   
  9601.   Return value        returns zero if ESC was hit, otherwise returns the
  9602.                       number of the command selected. This is not the
  9603.                       array index of the command. If command[] has 3
  9604.                       static text items and a command, and the command is
  9605.                       selected, a 1 will be returned, even though the
  9606.                       command is the fourth command with a command index
  9607.                       of three (command[3]).
  9608.   
  9609.   Note                Use menu_popup() when you want a one-shot menu, and
  9610.                       the popup...() functions when you plan on keeping
  9611.                       the menu on the screen for multiple choices
  9612.                       (perhaps when overlaying submenus).
  9613.   
  9614.   See also            menuhk.h
  9615.                       popup_alloc(), popup_free(), popup_get(),
  9616.                       popup_restore(), popup_setcurrent(), pophilite(),
  9617.                       popunlite()
  9618.                       popuperrno
  9619.   
  9620.   Example             see demopop.c
  9621.   
  9622.   
  9623.   
  9624.  
  9625.  
  9626.  
  9627.  
  9628.  
  9629.  
  9630.  
  9631.  
  9632.  
  9633.  
  9634.  
  9635.  
  9636.  
  9637.  
  9638.  
  9639.  
  9640.  
  9641.  
  9642.  
  9643.      TCHK 2.0                                               Page 146
  9644.  
  9645.   
  9646.   Function             mid - is a number within a range
  9647.   
  9648.   Syntax              #include <mathhk.h>
  9649.                       (boolean) mid(a,x,b)
  9650.   
  9651.   Prototype in        mathhk.h
  9652.   
  9653.   Remarks             mid checks if x is between a and b, inclusive.
  9654.   
  9655.                       This function is a macro.
  9656.   
  9657.   Return value        returns TRUE if x is between a and b, inclusive,
  9658.                       otherwise FALSE.
  9659.   
  9660.   
  9661.  
  9662.  
  9663.  
  9664.  
  9665.  
  9666.  
  9667.  
  9668.  
  9669.  
  9670.  
  9671.  
  9672.  
  9673.  
  9674.  
  9675.  
  9676.  
  9677.  
  9678.  
  9679.  
  9680.  
  9681.  
  9682.  
  9683.  
  9684.  
  9685.  
  9686.  
  9687.  
  9688.  
  9689.  
  9690.  
  9691.  
  9692.  
  9693.  
  9694.  
  9695.  
  9696.  
  9697.  
  9698.  
  9699.  
  9700.  
  9701.  
  9702.  
  9703.  
  9704.  
  9705.  
  9706.  
  9707.  
  9708.  
  9709.      TCHK 2.0                                               Page 147
  9710.  
  9711.   
  9712.   Function             midstr - return the middle portion of a string
  9713.   
  9714.   Syntax              char *midstr(char *source, int begin, int len);
  9715.   
  9716.   Prototype in        stringhk.h
  9717.   
  9718.   Remarks             midstr performs just like its BASIC counterpart
  9719.                       MID$().
  9720.   
  9721.                       midstr returns the middle part of a string.
  9722.   
  9723.   Return value        midstr returns the substring of source, using begin
  9724.                       as the offset from the beginning to start the
  9725.                       substring, for len characters.
  9726.   
  9727.                       midstr returns a pointer to the storage location
  9728.                       containing the new string, or NULL if space could
  9729.                       not be allocated.
  9730.   
  9731.   See also            leftstr(), rightstr()
  9732.   
  9733.   Example             #include <stringhk.h>
  9734.                       #include <stdio.h>            /* for the printf */
  9735.   
  9736.                       main()
  9737.                       {
  9738.                            char msg[25], *m;
  9739.   
  9740.                            strcpy(msg,"This is another test");
  9741.                            m = midstr(msg,5,7);
  9742.                            printf("%s\n",msg);
  9743.                            printf("%s\n",m);
  9744.                       }
  9745.   
  9746.   Program output      This is another test
  9747.                       is anot
  9748.   
  9749.   
  9750.  
  9751.  
  9752.  
  9753.  
  9754.  
  9755.  
  9756.  
  9757.  
  9758.  
  9759.  
  9760.  
  9761.  
  9762.  
  9763.  
  9764.  
  9765.  
  9766.  
  9767.  
  9768.  
  9769.  
  9770.  
  9771.  
  9772.  
  9773.  
  9774.  
  9775.      TCHK 2.0                                               Page 148
  9776.  
  9777.   
  9778.   Function             monthexpand - convert a month abbrev to its name
  9779.   
  9780.   Syntax              char *monthexpand(int month);
  9781.   
  9782.   Prototype in        datehk.h
  9783.   
  9784.   Remarks             monthexpand returns the name of a month given its
  9785.                       numeric abbreviation.
  9786.   
  9787.                       monthexpand returns an element of a static char
  9788.                       array, so you should not make any changes directly
  9789.                       to the returned value, but rather copy the returned
  9790.                       value to a safe piece of memory.
  9791.   
  9792.   Return value        returns a pointer to the storage location
  9793.                       containing the date structure, or NULL if the month
  9794.                       given is invalid.
  9795.   
  9796.   See also            Months[], MonthAbbr[]  (global variables)
  9797.                       Cal...(), date_convert(), ddatetofull(),
  9798.                       ddatetoshort(), ddatetostr(), fulltoddate(),
  9799.                       Greg...(), Jul...(), shorttoddate(), strtoddate()
  9800.   
  9801.   Example             #include <datehk.h>
  9802.   
  9803.                       main()
  9804.                       {
  9805.                            printf("Month 4 = %s\n",monthexpand(4));
  9806.                       }
  9807.   
  9808.   Program output      Month 4 = April
  9809.   
  9810.  
  9811.  
  9812.  
  9813.  
  9814.  
  9815.  
  9816.  
  9817.  
  9818.  
  9819.  
  9820.  
  9821.  
  9822.  
  9823.  
  9824.  
  9825.  
  9826.  
  9827.  
  9828.  
  9829.  
  9830.  
  9831.  
  9832.  
  9833.  
  9834.  
  9835.  
  9836.  
  9837.  
  9838.  
  9839.  
  9840.  
  9841.      TCHK 2.0                                               Page 149
  9842.  
  9843.   
  9844.   Function             ndp_id - identify the math coprocessor
  9845.   
  9846.   Syntax              int ndp_id(void);
  9847.   
  9848.   Prototype in        chiphk.h
  9849.   
  9850.   Remarks             ndp_id does some opcode magic to identify the
  9851.                       numerical data processor (math coprocessor as it's
  9852.                       commonly called.) If a math coprocessor is present,
  9853.                       ndp_id recognizes the 8087, 80287, and the 80387.
  9854.   
  9855.                       ndp_id does not check dip switches but uses the
  9856.                       recommended method of identifying a math chip by
  9857.                       opcode instructions.
  9858.   
  9859.   Return value        returns a value identifying the math coprocessor.
  9860.                       See chiphk.h for further details.
  9861.   
  9862.   Note                Other (not 8087, 287 or 387) chips will not be
  9863.                       identified correctly.
  9864.   
  9865.                       For some reason this function keeps crashing on my
  9866.                       machine. Consider this function under works, not
  9867.                       necessarily finished. If you figure out what the
  9868.                       problem is, please let me know. I hope to have it
  9869.                       bug free by the next release, but time is at a
  9870.                       premium.
  9871.   
  9872.   See also            cpu_id(), machine_id()
  9873.   
  9874.  
  9875.  
  9876.  
  9877.  
  9878.  
  9879.  
  9880.  
  9881.  
  9882.  
  9883.  
  9884.  
  9885.  
  9886.  
  9887.  
  9888.  
  9889.  
  9890.  
  9891.  
  9892.  
  9893.  
  9894.  
  9895.  
  9896.  
  9897.  
  9898.  
  9899.  
  9900.  
  9901.  
  9902.  
  9903.  
  9904.  
  9905.  
  9906.  
  9907.      TCHK 2.0                                               Page 150
  9908.  
  9909.   
  9910.   Function             NumLock - set the Num Lock key state
  9911.   
  9912.   Syntax              void NumLock(boolean on);
  9913.   
  9914.   Prototype in        ibm.h
  9915.   
  9916.   Remarks             sets the Num Lock key state to the state selected
  9917.                       by the on parameter.
  9918.   
  9919.   Return value        nothing.
  9920.   
  9921.   See also            CapsLock(), InsLock(), SrollLock()
  9922.   
  9923.  
  9924.  
  9925.  
  9926.  
  9927.  
  9928.  
  9929.  
  9930.  
  9931.  
  9932.  
  9933.  
  9934.  
  9935.  
  9936.  
  9937.  
  9938.  
  9939.  
  9940.  
  9941.  
  9942.  
  9943.  
  9944.  
  9945.  
  9946.  
  9947.  
  9948.  
  9949.  
  9950.  
  9951.  
  9952.  
  9953.  
  9954.  
  9955.  
  9956.  
  9957.  
  9958.  
  9959.  
  9960.  
  9961.  
  9962.  
  9963.  
  9964.  
  9965.  
  9966.  
  9967.  
  9968.  
  9969.  
  9970.  
  9971.  
  9972.  
  9973.      TCHK 2.0                                               Page 151
  9974.  
  9975.   
  9976.   Function             parsefilename - parses a filename, supports paths
  9977.   
  9978.   Syntax              struct filespec *parsefilename(char *fspec);
  9979.   
  9980.   Prototype in        filehk.h
  9981.   
  9982.   Remarks             parsefilename parses a string pointed to by fspec
  9983.                       for a file name. The file name is placed in a
  9984.                       struct filespec as a drive, path, and filename.ext.
  9985.                       Wildcards are supported. The struct filespec is
  9986.                       returned as follows:
  9987.   
  9988.                            drive          NULL (\0) if not given, else
  9989.                                           drive letter
  9990.                            path           NULL string ("") if not given,
  9991.                                           else the path with a \ added to
  9992.                                           the end of the path string
  9993.                            filename.ext   NULL string ("") if no file
  9994.                                           name given, else a filename.ext
  9995.                                           as per standard DOS file names.
  9996.   
  9997.                       The filename.ext is not expanded (i.e. c:tchk.lib
  9998.                       has a filename.ext of tchk.lib, but c:tchk. has a
  9999.                       filename.ext of tchk., and c:tchk has a
  10000.                       filename.ext of tchk.).
  10001.   
  10002.                       parsefilename is intelligent enough to know that
  10003.                       c:. expands out to C:.\*.*, where . is a path.
  10004.   
  10005.                       parsefilename is very similar to Borland's
  10006.                       parsefnm(), except Borland's function does NOT
  10007.                       handle paths, whereas parsefilename will (since
  10008.                       parsefnm() is just a DOS call, and we all know who
  10009.                       writes that wonderful operating system MS-DOS,
  10010.                       don't we?)
  10011.   
  10012.                       Limited error checking is performed, so beware. The
  10013.                       string will be parsed properly, but errors due to
  10014.                       long strings (i.e. strlen(fspec) > 100) and other
  10015.                       miscellania can cause extensive damage due to
  10016.                       pointer manipulations.
  10017.   
  10018.                       Furthermore, an invalid string (i.e. C:\TC\;HK\Z.C)
  10019.                       will not be treated as an error. The string is
  10020.                       parsed from the beginning to look for a drive
  10021.                       letter, and scanned from the right to the left,
  10022.                       stopping at the first \. If a \ is found,
  10023.                       everything to the right of it is considered the
  10024.                       file name, everything to the left is the path
  10025.                       (excluding the drive). You are responsible for
  10026.                       making sure fspec is a valid DOS drive, path and
  10027.                       file name.
  10028.   
  10029.   
  10030.  
  10031.  
  10032.  
  10033.  
  10034.  
  10035.  
  10036.  
  10037.  
  10038.  
  10039.      TCHK 2.0                                               Page 152
  10040.  
  10041.   Return value        parsefilename returns the DOS file name fspec
  10042.                       broken down into drive, path and filename.ext.
  10043.   
  10044.                       parsefilename returns a pointer to the storage
  10045.                       location containing the struct filespec, or NULL if
  10046.                       space could not be allocated.
  10047.   
  10048.   See also            getfilespec(), parsefnameext()
  10049.   
  10050.   Example             see demopars.c
  10051.   
  10052.   
  10053.  
  10054.  
  10055.  
  10056.  
  10057.  
  10058.  
  10059.  
  10060.  
  10061.  
  10062.  
  10063.  
  10064.  
  10065.  
  10066.  
  10067.  
  10068.  
  10069.  
  10070.  
  10071.  
  10072.  
  10073.  
  10074.  
  10075.  
  10076.  
  10077.  
  10078.  
  10079.  
  10080.  
  10081.  
  10082.  
  10083.  
  10084.  
  10085.  
  10086.  
  10087.  
  10088.  
  10089.  
  10090.  
  10091.  
  10092.  
  10093.  
  10094.  
  10095.  
  10096.  
  10097.  
  10098.  
  10099.  
  10100.  
  10101.  
  10102.  
  10103.  
  10104.  
  10105.      TCHK 2.0                                               Page 153
  10106.  
  10107.   
  10108.   Function             parsefnameext - parses a filename into name and
  10109.                                         extension
  10110.   
  10111.   Syntax              struct fnameext *parsefnameext(char *filename);
  10112.   
  10113.   Prototype in        filehk.h
  10114.   
  10115.   Remarks             parsefnameext parses a string pointed to by
  10116.                       filename into its elements, filename and extension.
  10117.                       The struct fnameext is returned with the file name
  10118.                       and extension as fixed length strings, padded with
  10119.                       spaces as necessary.
  10120.   
  10121.                       parsefnameext is useful for separating a DOS
  10122.                       filename into its discrete parts.
  10123.   
  10124.   Return value        parsefnameext returns the DOS file name filename
  10125.                       broken down into the structure fnameext as the name
  10126.                       and extension.
  10127.   
  10128.                       parsefnameext returns a pointer to the storage
  10129.                       location containing the struct fnameext, or NULL if
  10130.                       space could not be allocated.
  10131.   
  10132.   See also            getfilespec(), parsefilename()
  10133.   
  10134.   Example             see demopars.c
  10135.   
  10136.   
  10137.  
  10138.  
  10139.  
  10140.  
  10141.  
  10142.  
  10143.  
  10144.  
  10145.  
  10146.  
  10147.  
  10148.  
  10149.  
  10150.  
  10151.  
  10152.  
  10153.  
  10154.  
  10155.  
  10156.  
  10157.  
  10158.  
  10159.  
  10160.  
  10161.  
  10162.  
  10163.  
  10164.  
  10165.  
  10166.  
  10167.  
  10168.  
  10169.  
  10170.  
  10171.      TCHK 2.0                                               Page 154
  10172.  
  10173.   
  10174.   Function             pause - wait for a time or until a keypress
  10175.   
  10176.   Syntax              int pause(int wait);
  10177.   
  10178.   Prototype in        timehk.h
  10179.   
  10180.   Remarks             waits for a time, or until a key is pressed.
  10181.                       Similiar to delay(), but can be aborted by a
  10182.                       keypress. wait is given in 1/100s of a second
  10183.   
  10184.   Return value        returns zero if the time elapsed, otherwise the
  10185.                       scan code of the key pressed.
  10186.   
  10187.   
  10188.  
  10189.  
  10190.  
  10191.  
  10192.  
  10193.  
  10194.  
  10195.  
  10196.  
  10197.  
  10198.  
  10199.  
  10200.  
  10201.  
  10202.  
  10203.  
  10204.  
  10205.  
  10206.  
  10207.  
  10208.  
  10209.  
  10210.  
  10211.  
  10212.  
  10213.  
  10214.  
  10215.  
  10216.  
  10217.  
  10218.  
  10219.  
  10220.  
  10221.  
  10222.  
  10223.  
  10224.  
  10225.  
  10226.  
  10227.  
  10228.  
  10229.  
  10230.  
  10231.  
  10232.  
  10233.  
  10234.  
  10235.  
  10236.  
  10237.      TCHK 2.0                                               Page 155
  10238.  
  10239.   
  10240.   Function             PMT - calculate the periodic payment required to
  10241.                               fully amortize a principal
  10242.   
  10243.   Syntax              double PMT(double principal, double interest, int
  10244.                                  periods)
  10245.   
  10246.   Prototype in        finance.h
  10247.   
  10248.   Remarks             PMT calculates the periodic payment required to
  10249.                       fully amortize a principal over some amount of
  10250.                       periods.
  10251.   
  10252.   Return value        returns the periodic payment required to fully
  10253.                       amortize a principal over an amount of periods.
  10254.   
  10255.   See also            FV(), FVa(), PV(), PVa()
  10256.   
  10257.   
  10258.  
  10259.  
  10260.  
  10261.  
  10262.  
  10263.  
  10264.  
  10265.  
  10266.  
  10267.  
  10268.  
  10269.  
  10270.  
  10271.  
  10272.  
  10273.  
  10274.  
  10275.  
  10276.  
  10277.  
  10278.  
  10279.  
  10280.  
  10281.  
  10282.  
  10283.  
  10284.  
  10285.  
  10286.  
  10287.  
  10288.  
  10289.  
  10290.  
  10291.  
  10292.  
  10293.  
  10294.  
  10295.  
  10296.  
  10297.  
  10298.  
  10299.  
  10300.  
  10301.  
  10302.  
  10303.      TCHK 2.0                                               Page 156
  10304.  
  10305.   
  10306.   Function             popup_alloc - allocate memory for a popup menu
  10307.   
  10308.   Syntax              struct popup_header *popup_alloc(int left, int top,
  10309.                                      int right, int bottom, char *frame,
  10310.                                      char *title, int titlejustify, char
  10311.                                      *command[], int cmdkey[], char
  10312.                                      cmdflag[], int colframe, int
  10313.                                      coltitle, int colnorm, int
  10314.                                      colcmdkey, int colhilite, int
  10315.                                      coldisable, int coldishilite, int
  10316.                                      colnotopt, int defaultcommand,
  10317.                                      unsigned flags);
  10318.   
  10319.   Prototype in        menuhk.h
  10320.   
  10321.   Remarks             popup_alloc creates a popup menu with the following
  10322.                       information:
  10323.   
  10324.                       Coordinates of the frame of the popup menu are
  10325.                       (left,top) to (right,bottom), the border is made up
  10326.                       of the 9 or 11 chars in frame (0 to 8 or 10) as per
  10327.                       boxwindow(), with an optional title on the top edge
  10328.                       of the menu border, justified left, right or center
  10329.                       (see howard.h for more details).
  10330.   
  10331.                       The command array is a list of strings or text to
  10332.                       be displayed on the screen. popup_alloc knows how
  10333.                       many commands it needs by the size of the box, one
  10334.                       per line (i.e. coordinates (1,1) to (10,5) would
  10335.                       need 3 commands since there are 3 lines inside the
  10336.                       popup box).
  10337.   
  10338.                       Each command can have a hotkey associated with it,
  10339.                       denoted by the appropriate cmdkey[]. The 'hotkey'
  10340.                       is actually a one-touch key, instantly moving to
  10341.                       and selecting a choice. The cmdkey value is an
  10342.                       offset into the command string. For example, a
  10343.                       command "Edit" with a hotkey of the "E" would have
  10344.                       a cmdkey value of 0 (an offset from the beginning
  10345.                       of the command). A command without a hotkey has a
  10346.                       cmdkey value of -1.
  10347.   
  10348.                       Each command has an appropriate cmdflag field. A
  10349.                       command may be either:
  10350.   
  10351.                            ENABLED     - a valid choice
  10352.                            DISABLED    - displayed, but not selectable
  10353.                            NOTOPTION   - not a command (static text)
  10354.   
  10355.                       These are defined in menuhk.h. Other values may
  10356.                       cause unpredictable results.
  10357.   
  10358.   
  10359.  
  10360.  
  10361.  
  10362.  
  10363.  
  10364.  
  10365.  
  10366.  
  10367.  
  10368.  
  10369.      TCHK 2.0                                               Page 157
  10370.  
  10371.                       The following colors are used:
  10372.   
  10373.                            colframe       - frame around menu
  10374.                            coltitle       - title (if any)
  10375.                            colnorm        - enabled commands
  10376.                            colcmdkey      - hotkey in command
  10377.                            colhilite      - currently hilited option
  10378.                            coldisable     - disabled options
  10379.                            coldishilite   - disabled and currently
  10380.                                             hilited
  10381.                            colnotopt      - static text (NOTOPTION)
  10382.   
  10383.                       defaultcommand is the command initially hilited. If
  10384.                       an invalid command is chosen (the command is static
  10385.                       text, or does not exist, etc.) the first valid
  10386.                       command is the default.
  10387.   
  10388.                       flags is a 2-byte bit field of flags
  10389.   
  10390.                            QEFxxxxH xxIRCEDW
  10391.   
  10392.                       where
  10393.   
  10394.                            Q = Quit after selection
  10395.                            E = ESC means quit
  10396.                            F = Free memory on quit
  10397.                            H = Hierarchial menu (not implemented yet)
  10398.                            I = cmdkeys are case Independent
  10399.                            R = Restore cursor before returning
  10400.                            C = don't hide Cursor
  10401.                            E = Erase menu on free/cleanup
  10402.                            D = Disabled off (can be selected)
  10403.                            W = Wraparound
  10404.   
  10405.                       Briefly, Quit will restore the display to the state
  10406.                       it was in before the popup menu was called
  10407.                       (settextinfo(), etc.). With E, if ESC is pressed
  10408.                       the menu is removed, for any other selection no
  10409.                       cleanup is done (unless Q is specified). Free
  10410.                       memory on quit calls popup_free() after a selection
  10411.                       is made. Hierarchial menus are not implemented yet.
  10412.                       Keys are input via inkey() or inkeyc(), depending
  10413.                       on case Independency. When popup_get() is called,
  10414.                       the cursor is hidden unless C is given. The cursor
  10415.                       is unhidden only if R is given. E will cause the
  10416.                       menu to be erased from the screen if quitting.
  10417.                       Disbaled commands are not normally selectable,
  10418.                       unless D is on. Wraparound allows the selecting
  10419.                       hilite bar to wrap over the top and under the
  10420.                       bottom.
  10421.   
  10422.   
  10423.   Return value        allocates and returns a pointer to a popup header
  10424.                       structure if the menu was successfully created, 
  10425.  
  10426.  
  10427.  
  10428.  
  10429.  
  10430.  
  10431.  
  10432.  
  10433.  
  10434.  
  10435.      TCHK 2.0                                               Page 158
  10436.  
  10437.                       otherwise returns NULL if an error occurred.
  10438.                       popuperrno will have the following values:
  10439.   
  10440.                            0    success
  10441.                            1    error, could not allocate popup header
  10442.                            2    error, could not allocate videosave
  10443.                            3    error, could not allocate menusave
  10444.                            5    error, could not allocate popup field
  10445.                            6    error, could not allocate command string
  10446.                            7    error, no menu item enabled (no commands)
  10447.   
  10448.   Note                The popup_header structure contains important
  10449.                       information about the menu, including pointers to
  10450.                       linked lists for the fields, saved video displays,
  10451.                       etc. I strongly advise that you don't even think of
  10452.                       modifying this information yourself. Let the
  10453.                       popup...() functions handle it for you. These
  10454.                       functions have been developed and used over a
  10455.                       period of several months, programs and conditions
  10456.                       which proves them to be vitually bug free. If you
  10457.                       really want to mess with them yourself, feel free.
  10458.                       But I certainly wouldn't want to attempt it.
  10459.                       Modifying these functions even with the srource
  10460.                       code is a headache.
  10461.   
  10462.   See also            menuhk.h
  10463.                       menu_popup(), popup_free(), popup_get(),
  10464.                       popup_restore(), popup_setcurrent(), pophilite(),
  10465.                       popunlite()
  10466.                       popuperrno
  10467.   
  10468.   Example             see demopop.c
  10469.   
  10470.   
  10471.  
  10472.  
  10473.  
  10474.  
  10475.  
  10476.  
  10477.  
  10478.  
  10479.  
  10480.  
  10481.  
  10482.  
  10483.  
  10484.  
  10485.  
  10486.  
  10487.  
  10488.  
  10489.  
  10490.  
  10491.  
  10492.  
  10493.  
  10494.  
  10495.  
  10496.  
  10497.  
  10498.  
  10499.  
  10500.  
  10501.      TCHK 2.0                                               Page 159
  10502.  
  10503.   
  10504.   Function             popup_free - frees memory allocated by popup menu
  10505.   
  10506.   Syntax              void popup_free(struct popup_header *ph);
  10507.   
  10508.   Prototype in        menuhk.h
  10509.   
  10510.   Remarks             frees all memory allocated to a popup menu.
  10511.   
  10512.   Return value        nothing.
  10513.   
  10514.   Note                see popup_alloc()
  10515.   
  10516.   See also            menuhk.h
  10517.                       menu_popup(), popup_alloc(), popup_get(),
  10518.                       popup_restore(), popup_setcurrent(), pophilite(),
  10519.                       popunlite()
  10520.                       popuperrno
  10521.   
  10522.   Example             see demopop.c
  10523.   
  10524.   
  10525.  
  10526.  
  10527.  
  10528.  
  10529.  
  10530.  
  10531.  
  10532.  
  10533.  
  10534.  
  10535.  
  10536.  
  10537.  
  10538.  
  10539.  
  10540.  
  10541.  
  10542.  
  10543.  
  10544.  
  10545.  
  10546.  
  10547.  
  10548.  
  10549.  
  10550.  
  10551.  
  10552.  
  10553.  
  10554.  
  10555.  
  10556.  
  10557.  
  10558.  
  10559.  
  10560.  
  10561.  
  10562.  
  10563.  
  10564.  
  10565.  
  10566.  
  10567.      TCHK 2.0                                               Page 160
  10568.  
  10569.   
  10570.   Function             popup_get - get user's choice from a popup menu
  10571.   
  10572.   Syntax              int popup_get(struct popup_header *ph);
  10573.   
  10574.   Prototype in        menuhk.h
  10575.   
  10576.   Remarks             popup_get does the actual prompting the user for
  10577.                       input. The following keys can be used to navigate
  10578.                       in the menu:
  10579.   
  10580.                            Up Arrow       Move select bar up one option
  10581.                            Down Arrow     Move select bar down one option
  10582.                            Home           Move select bar to first option
  10583.                            End            Move select bar to last option
  10584.                            ENTER          Select the hilited option
  10585.                            ESC            Abort
  10586.   
  10587.                       in addition to any cmdkeys.
  10588.   
  10589.                       Other actions may be taken before returning from
  10590.                       this function, according to the flags for the menu.
  10591.                       See popup_alloc() for more details.
  10592.   
  10593.   Return value        returns zero if ESC was hit, otherwise returns the
  10594.                       number of the command selected. This is not the
  10595.                       array index of the command. If command[] has 3
  10596.                       static text items and a command, and the command is
  10597.                       selected, a 1 will be returned, even though the
  10598.                       command is the fourth command with a command index
  10599.                       of three (command[3]).
  10600.   
  10601.   See also            menuhk.h
  10602.                       menu_popup(), popup_alloc(), popup_free(),
  10603.                       popup_restore(), popup_setcurrent(), pophilite(),
  10604.                       popunlite()
  10605.                       popuperrno
  10606.   
  10607.   Example             see demopop.c
  10608.   
  10609.   
  10610.  
  10611.  
  10612.  
  10613.  
  10614.  
  10615.  
  10616.  
  10617.  
  10618.  
  10619.  
  10620.  
  10621.  
  10622.  
  10623.  
  10624.  
  10625.  
  10626.  
  10627.  
  10628.  
  10629.  
  10630.  
  10631.  
  10632.  
  10633.      TCHK 2.0                                               Page 161
  10634.  
  10635.   
  10636.   Function             popup_restore - restore video from a popup menu
  10637.   
  10638.   Syntax              void popup_restore(struct popup_header *ph);
  10639.   
  10640.   Prototype in        menuhk.h
  10641.   
  10642.   Remarks             restores the display overlaid by a popup menu and
  10643.                       appropriate display information.
  10644.   
  10645.                       This function is used internally by several
  10646.                       popup...() menu functions.
  10647.   
  10648.   Return value        nothing.
  10649.   
  10650.   Note                This function is for internal uses only.
  10651.   
  10652.   See also            menuhk.h
  10653.                       menu_popup(), popup_alloc(), popup_free(),
  10654.                       popup_get(), popup_setcurrent(), pophilite(),
  10655.                       popunlite()
  10656.                       popuperrno
  10657.   
  10658.   
  10659.  
  10660.  
  10661.  
  10662.  
  10663.  
  10664.  
  10665.  
  10666.  
  10667.  
  10668.  
  10669.  
  10670.  
  10671.  
  10672.  
  10673.  
  10674.  
  10675.  
  10676.  
  10677.  
  10678.  
  10679.  
  10680.  
  10681.  
  10682.  
  10683.  
  10684.  
  10685.  
  10686.  
  10687.  
  10688.  
  10689.  
  10690.  
  10691.  
  10692.  
  10693.  
  10694.  
  10695.  
  10696.  
  10697.  
  10698.  
  10699.      TCHK 2.0                                               Page 162
  10700.  
  10701.   
  10702.   Function             popup_setcurrent - set internal popup menu
  10703.                                            information
  10704.   
  10705.   Syntax              int popup_setcurrent(struct popup_header *ph,
  10706.                                            int current);
  10707.   Prototype in        
  10708.   
  10709.   Remarks             sets internal variables for a popup menu regarding
  10710.                       the currently hilited item.
  10711.   
  10712.                       This function is used internally by several
  10713.                       popup...() menu functions.
  10714.   
  10715.   Return value        returns return value for newly hilited command. IF
  10716.                       there are no other selectable commands, returns -1.
  10717.   
  10718.   Note                This function is for internal uses only.
  10719.   
  10720.   See also            menuhk.h
  10721.                       menu_popup(), popup_alloc(), popup_free(),
  10722.                       popup_get(), popup_restore(), pophilite(),
  10723.                       popunlite()
  10724.                       popuperrno
  10725.   
  10726.   
  10727.  
  10728.  
  10729.  
  10730.  
  10731.  
  10732.  
  10733.  
  10734.  
  10735.  
  10736.  
  10737.  
  10738.  
  10739.  
  10740.  
  10741.  
  10742.  
  10743.  
  10744.  
  10745.  
  10746.  
  10747.  
  10748.  
  10749.  
  10750.  
  10751.  
  10752.  
  10753.  
  10754.  
  10755.  
  10756.  
  10757.  
  10758.  
  10759.  
  10760.  
  10761.  
  10762.  
  10763.  
  10764.  
  10765.      TCHK 2.0                                               Page 163
  10766.  
  10767.   
  10768.   Function             pophilite - hilite a popup menu command
  10769.   
  10770.   Syntax              void pophilite(struct popup_header *ph);
  10771.   
  10772.   Prototype in        menuhk.h
  10773.   
  10774.   Remarks             displays a popup menu command in the hilited color
  10775.                       via Borland's console i/o.
  10776.   
  10777.                       This function is used internally by several
  10778.                       popup...() menu functions.
  10779.   
  10780.   Return value        nothing.
  10781.   
  10782.   Note                This function is for internal uses only.
  10783.   
  10784.   See also            menuhk.h
  10785.                       menu_popup(), popup_alloc(), popup_free(),
  10786.                       popup_get(), popup_restore(), popup_setcurrent(),
  10787.                       popunlite()
  10788.                       popuperrno
  10789.   
  10790.   
  10791.  
  10792.  
  10793.  
  10794.  
  10795.  
  10796.  
  10797.  
  10798.  
  10799.  
  10800.  
  10801.  
  10802.  
  10803.  
  10804.  
  10805.  
  10806.  
  10807.  
  10808.  
  10809.  
  10810.  
  10811.  
  10812.  
  10813.  
  10814.  
  10815.  
  10816.  
  10817.  
  10818.  
  10819.  
  10820.  
  10821.  
  10822.  
  10823.  
  10824.  
  10825.  
  10826.  
  10827.  
  10828.  
  10829.  
  10830.  
  10831.      TCHK 2.0                                               Page 164
  10832.  
  10833.   
  10834.   Function             popunlite - unhilite a popup menu command
  10835.   
  10836.   Syntax              void popunlite(struct popup_header *ph);
  10837.   
  10838.   Prototype in        menuhk.h
  10839.   
  10840.   Remarks             displays a popup menu command in its unhilited
  10841.                       color(s).
  10842.   
  10843.                       This function is used internally by several
  10844.                       popup...() menu functions.
  10845.   
  10846.   Return value        nothing.
  10847.   
  10848.   Note                This function is for internal uses only.
  10849.   
  10850.   See also            menuhk.h
  10851.                       menu_popup(), popup_alloc(), popup_free(),
  10852.                       popup_get(), popup_restore(), popup_setcurrent(),
  10853.                       pophilite()
  10854.                       popuperrno
  10855.   
  10856.   
  10857.  
  10858.  
  10859.  
  10860.  
  10861.  
  10862.  
  10863.  
  10864.  
  10865.  
  10866.  
  10867.  
  10868.  
  10869.  
  10870.  
  10871.  
  10872.  
  10873.  
  10874.  
  10875.  
  10876.  
  10877.  
  10878.  
  10879.  
  10880.  
  10881.  
  10882.  
  10883.  
  10884.  
  10885.  
  10886.  
  10887.  
  10888.  
  10889.  
  10890.  
  10891.  
  10892.  
  10893.  
  10894.  
  10895.  
  10896.  
  10897.      TCHK 2.0                                               Page 165
  10898.  
  10899.   
  10900.   Function             print_screen - issue a PrintScreen
  10901.   
  10902.   Syntax              int print_screen(void);
  10903.   
  10904.   Prototype in        printhk.h
  10905.   
  10906.   Remarks             issues a Print Screen command as if PrtSc were
  10907.                       pressed.
  10908.   
  10909.   Return value        returns zero if the PrtSc is done, a one if the
  10910.                       PtrSc is in progress and 0xFF is an error occurred.
  10911.                       See printhk.h for further information.
  10912.   
  10913.   See also            isPRINTavail(), PRINTadd(), PRINThold(),
  10914.                       PRINTpurge(), PRINTremove(), PRINTresume
  10915.   
  10916.   
  10917.  
  10918.  
  10919.  
  10920.  
  10921.  
  10922.  
  10923.  
  10924.  
  10925.  
  10926.  
  10927.  
  10928.  
  10929.  
  10930.  
  10931.  
  10932.  
  10933.  
  10934.  
  10935.  
  10936.  
  10937.  
  10938.  
  10939.  
  10940.  
  10941.  
  10942.  
  10943.  
  10944.  
  10945.  
  10946.  
  10947.  
  10948.  
  10949.  
  10950.  
  10951.  
  10952.  
  10953.  
  10954.  
  10955.  
  10956.  
  10957.  
  10958.  
  10959.  
  10960.  
  10961.  
  10962.  
  10963.      TCHK 2.0                                               Page 166
  10964.  
  10965.   
  10966.   Function             PRINTadd - add a file to the print queue
  10967.   
  10968.   Syntax              int PRINTadd(char *filename, int level);
  10969.   
  10970.   Prototype in        printhk.h
  10971.   
  10972.   Remarks             adds a file to the print queue. The filename may
  10973.                       NOT have wildcards. The priority level is
  10974.                       determined by level.
  10975.   
  10976.   Return value        returns zero if no error occurred, otherwise
  10977.                       returns the error code. See printhk.h for a full
  10978.                       list of the error return codes.
  10979.   
  10980.   Note                requires DOS 3.1 or greater.
  10981.   
  10982.   See also            isPRINTavail(), PRINThold(), PRINTpurge(),
  10983.                       PRINTremove(), PRINTresume
  10984.   
  10985.   
  10986.  
  10987.  
  10988.  
  10989.  
  10990.  
  10991.  
  10992.  
  10993.  
  10994.  
  10995.  
  10996.  
  10997.  
  10998.  
  10999.  
  11000.  
  11001.  
  11002.  
  11003.  
  11004.  
  11005.  
  11006.  
  11007.  
  11008.  
  11009.  
  11010.  
  11011.  
  11012.  
  11013.  
  11014.  
  11015.  
  11016.  
  11017.  
  11018.  
  11019.  
  11020.  
  11021.  
  11022.  
  11023.  
  11024.  
  11025.  
  11026.  
  11027.  
  11028.  
  11029.      TCHK 2.0                                               Page 167
  11030.  
  11031.   
  11032.   Function             PRINThold - hold print queue for status read
  11033.   
  11034.   Syntax              int PRINThold(char far *queue);
  11035.   
  11036.   Prototype in        printhk.h
  11037.   
  11038.   Remarks             puts the print queue on hold and gets the status of
  11039.                       the print queue. The parameter queue is a far
  11040.                       pointer to a series of filename entries. Each entry
  11041.                       is 64 bytes long and contains a null terminated
  11042.                       string that is a file specification. The first file
  11043.                       specification in the queue is the one currently
  11044.                       being printed. The last slot in the queue is an
  11045.                       empty string (the first byte is '\0').
  11046.   
  11047.                       The print queue will not resume until a
  11048.                       PRINTresume() is issued.
  11049.   
  11050.   Return value        returns zero if no error occurred, otherwise
  11051.                       returns the error code. See printhk.h for a full
  11052.                       list of the error return codes.
  11053.   
  11054.   Note                requires DOS 3.1 or greater.
  11055.   
  11056.   See also            isPRINTavail(), PRINTadd(), PRINTpurge(),
  11057.                       PRINTremove(), PRINTresume
  11058.   
  11059.   
  11060.  
  11061.  
  11062.  
  11063.  
  11064.  
  11065.  
  11066.  
  11067.  
  11068.  
  11069.  
  11070.  
  11071.  
  11072.  
  11073.  
  11074.  
  11075.  
  11076.  
  11077.  
  11078.  
  11079.  
  11080.  
  11081.  
  11082.  
  11083.  
  11084.  
  11085.  
  11086.  
  11087.  
  11088.  
  11089.  
  11090.  
  11091.  
  11092.  
  11093.  
  11094.  
  11095.      TCHK 2.0                                               Page 168
  11096.  
  11097.   
  11098.   Function             PRINTpurge - remove all files from print queue
  11099.   
  11100.   Syntax              int PRINTpurge(void);
  11101.   
  11102.   Prototype in        printhk.h
  11103.   
  11104.   Remarks             removes all files from the print queue.
  11105.   
  11106.   Return value        returns zero if no error occurred, otherwise
  11107.                       returns the error code. See printhk.h for a full
  11108.                       list of the error return codes.
  11109.   
  11110.   Note                requires DOS 3.1 or greater.
  11111.   
  11112.   See also            isPRINTavail(), PRINTadd(), PRINThold(),
  11113.                       PRINTremove(), PRINTresume
  11114.   
  11115.   
  11116.  
  11117.  
  11118.  
  11119.  
  11120.  
  11121.  
  11122.  
  11123.  
  11124.  
  11125.  
  11126.  
  11127.  
  11128.  
  11129.  
  11130.  
  11131.  
  11132.  
  11133.  
  11134.  
  11135.  
  11136.  
  11137.  
  11138.  
  11139.  
  11140.  
  11141.  
  11142.  
  11143.  
  11144.  
  11145.  
  11146.  
  11147.  
  11148.  
  11149.  
  11150.  
  11151.  
  11152.  
  11153.  
  11154.  
  11155.  
  11156.  
  11157.  
  11158.  
  11159.  
  11160.  
  11161.      TCHK 2.0                                               Page 169
  11162.  
  11163.   
  11164.   Function             PRINTremove - remove a file from print queue
  11165.   
  11166.   Syntax              int PRINTremove(char *filename, int level);
  11167.   
  11168.   Prototype in        printhk.h
  11169.   
  11170.   Remarks             removes a file from the print queue. Wildcards are
  11171.                       allowed, so multiple files may be removed from the
  11172.                       queue with one call.
  11173.   
  11174.   Return value        returns zero if no error occurred, otherwise
  11175.                       returns the error code. See printhk.h for a full
  11176.                       list of the error return codes.
  11177.   
  11178.   Note                requires DOS 3.1 or greater.
  11179.   
  11180.   See also            isPRINTavail(), PRINTadd(), PRINThold(),
  11181.                       PRINTpurge(), PRINTresume
  11182.   
  11183.   
  11184.  
  11185.  
  11186.  
  11187.  
  11188.  
  11189.  
  11190.  
  11191.  
  11192.  
  11193.  
  11194.  
  11195.  
  11196.  
  11197.  
  11198.  
  11199.  
  11200.  
  11201.  
  11202.  
  11203.  
  11204.  
  11205.  
  11206.  
  11207.  
  11208.  
  11209.  
  11210.  
  11211.  
  11212.  
  11213.  
  11214.  
  11215.  
  11216.  
  11217.  
  11218.  
  11219.  
  11220.  
  11221.  
  11222.  
  11223.  
  11224.  
  11225.  
  11226.  
  11227.      TCHK 2.0                                               Page 170
  11228.  
  11229.   
  11230.   Function             PRINTresume - resume printing after a PRINThold
  11231.   
  11232.   Syntax              int PRINTresume(void);
  11233.   
  11234.   Prototype in        printhk.h
  11235.   
  11236.   Remarks             resumes printing from the print queue after a
  11237.                       PRINTresume() has been issued. The print queue will
  11238.                       not resume until a PRINTresume() is issued.
  11239.   
  11240.   Return value        returns zero if no error occurred, otherwise
  11241.                       returns the error code. See printhk.h for a full
  11242.                       list of the error return codes.
  11243.   
  11244.   Note                requires DOS 3.1 or greater.
  11245.   
  11246.   See also            isPRINTavail(), PRINTadd(), PRINThold(),
  11247.                       PRINTpurge(), PRINTremove()
  11248.   
  11249.   
  11250.  
  11251.  
  11252.  
  11253.  
  11254.  
  11255.  
  11256.  
  11257.  
  11258.  
  11259.  
  11260.  
  11261.  
  11262.  
  11263.  
  11264.  
  11265.  
  11266.  
  11267.  
  11268.  
  11269.  
  11270.  
  11271.  
  11272.  
  11273.  
  11274.  
  11275.  
  11276.  
  11277.  
  11278.  
  11279.  
  11280.  
  11281.  
  11282.  
  11283.  
  11284.  
  11285.  
  11286.  
  11287.  
  11288.  
  11289.  
  11290.  
  11291.  
  11292.  
  11293.      TCHK 2.0                                               Page 171
  11294.  
  11295.   
  11296.   Function             putk - put a character w/attribute on the screen
  11297.   
  11298.   Syntax              void putk(byte c);
  11299.   
  11300.   Prototype in        video.h
  11301.   
  11302.   Remarks             putk puts character c on the screen at the cursor
  11303.                       via INTerrupts. The cursor does NOT advance. The
  11304.                       attribute is set with the global variable
  11305.                       char_attribute.
  11306.   
  11307.   Return value        nothing.
  11308.   
  11309.   See also            putsay(), putstr(), set_color()
  11310.   
  11311.   Example             #include <video.h>
  11312.   
  11313.                       main()
  11314.                       {
  11315.                            gotohv(12,40);
  11316.                            putk('*');
  11317.                       }
  11318.   
  11319.  
  11320.  
  11321.  
  11322.  
  11323.  
  11324.  
  11325.  
  11326.  
  11327.  
  11328.  
  11329.  
  11330.  
  11331.  
  11332.  
  11333.  
  11334.  
  11335.  
  11336.  
  11337.  
  11338.  
  11339.  
  11340.  
  11341.  
  11342.  
  11343.  
  11344.  
  11345.  
  11346.  
  11347.  
  11348.  
  11349.  
  11350.  
  11351.  
  11352.  
  11353.  
  11354.  
  11355.  
  11356.  
  11357.  
  11358.  
  11359.      TCHK 2.0                                               Page 172
  11360.  
  11361.   
  11362.   Function             putsay - put a string with attribute on the
  11363.                                  screen
  11364.   
  11365.   Syntax              void putsay(int col, int row, byte *c);
  11366.   
  11367.   Prototype in        video.h
  11368.   
  11369.   Remarks             putsay puts string c on the screen at location
  11370.                       (col,row) via direct screen writes. It does retrace
  11371.                       checking to prevent snow on CGA systems. The
  11372.                       attribute is set with the global variable
  11373.                       char_attribute.
  11374.   
  11375.   Return value        nothing.
  11376.   
  11377.   See also            putk(), putstr(), set_color()
  11378.   
  11379.   Example             #include <video.h>
  11380.   
  11381.                       main()
  11382.                       {
  11383.                            putstr(12,40,(byte *)"Hello");
  11384.                       }
  11385.   
  11386.  
  11387.  
  11388.  
  11389.  
  11390.  
  11391.  
  11392.  
  11393.  
  11394.  
  11395.  
  11396.  
  11397.  
  11398.  
  11399.  
  11400.  
  11401.  
  11402.  
  11403.  
  11404.  
  11405.  
  11406.  
  11407.  
  11408.  
  11409.  
  11410.  
  11411.  
  11412.  
  11413.  
  11414.  
  11415.  
  11416.  
  11417.  
  11418.  
  11419.  
  11420.  
  11421.  
  11422.  
  11423.  
  11424.  
  11425.      TCHK 2.0                                               Page 173
  11426.  
  11427.   
  11428.   Function             putstr - put string with attribute on the screen
  11429.   
  11430.   Syntax              void putstr(byte *c);
  11431.   
  11432.   Prototype in        video.h
  11433.   
  11434.   Remarks             putstr puts string c on the screen at the cursor
  11435.                       via INTerrupts. When finished the cursor will be 1
  11436.                       spot after the string. The attribute is set with
  11437.                       the global variable char_attribute.
  11438.   
  11439.   Return value        nothing.
  11440.   
  11441.   See also            putk(), putsay(), set_color()
  11442.   
  11443.   Example             #include <video.h>
  11444.   
  11445.                       main()
  11446.                       {
  11447.                            gotohv(12,40);
  11448.                            putstr((byte *)"Hello");
  11449.                       }
  11450.   
  11451.  
  11452.  
  11453.  
  11454.  
  11455.  
  11456.  
  11457.  
  11458.  
  11459.  
  11460.  
  11461.  
  11462.  
  11463.  
  11464.  
  11465.  
  11466.  
  11467.  
  11468.  
  11469.  
  11470.  
  11471.  
  11472.  
  11473.  
  11474.  
  11475.  
  11476.  
  11477.  
  11478.  
  11479.  
  11480.  
  11481.  
  11482.  
  11483.  
  11484.  
  11485.  
  11486.  
  11487.  
  11488.  
  11489.  
  11490.  
  11491.      TCHK 2.0                                               Page 174
  11492.  
  11493.   
  11494.   Function             PV - calculate the Present Value of a single
  11495.                              amount
  11496.   
  11497.   Syntax              double PV(double payment, double interest, int
  11498.                                 periods)
  11499.   
  11500.   Prototype in        finance.h
  11501.   
  11502.   Remarks             PV calculates the Present Value of a single amount
  11503.                       given the future value of the principal, the
  11504.                       interest rate per period and the number of periods.
  11505.   
  11506.   Return value        returns the present value of a single amount.
  11507.   
  11508.   See also            FV(), FVa(), PMT(), PVa()
  11509.   
  11510.   
  11511.  
  11512.  
  11513.  
  11514.  
  11515.  
  11516.  
  11517.  
  11518.  
  11519.  
  11520.  
  11521.  
  11522.  
  11523.  
  11524.  
  11525.  
  11526.  
  11527.  
  11528.  
  11529.  
  11530.  
  11531.  
  11532.  
  11533.  
  11534.  
  11535.  
  11536.  
  11537.  
  11538.  
  11539.  
  11540.  
  11541.  
  11542.  
  11543.  
  11544.  
  11545.  
  11546.  
  11547.  
  11548.  
  11549.  
  11550.  
  11551.  
  11552.  
  11553.  
  11554.  
  11555.  
  11556.  
  11557.      TCHK 2.0                                               Page 175
  11558.  
  11559.   
  11560.   Function             PVa - calculate the Present Value of an annuity
  11561.   
  11562.   Syntax              double PVa(double payment, double interest, int
  11563.                                  periods)
  11564.   
  11565.   Prototype in        finance.h
  11566.   
  11567.   Remarks             PVa calculates the Present Value of an annuity
  11568.                       given the amount of each payment, the interest rate
  11569.                       per period and the number of periods.
  11570.   
  11571.   Return value        returns the present value of an annuity.
  11572.   
  11573.   See also            FV(), FVa(), PMT(), PV()
  11574.   
  11575.   
  11576.  
  11577.  
  11578.  
  11579.  
  11580.  
  11581.  
  11582.  
  11583.  
  11584.  
  11585.  
  11586.  
  11587.  
  11588.  
  11589.  
  11590.  
  11591.  
  11592.  
  11593.  
  11594.  
  11595.  
  11596.  
  11597.  
  11598.  
  11599.  
  11600.  
  11601.  
  11602.  
  11603.  
  11604.  
  11605.  
  11606.  
  11607.  
  11608.  
  11609.  
  11610.  
  11611.  
  11612.  
  11613.  
  11614.  
  11615.  
  11616.  
  11617.  
  11618.  
  11619.  
  11620.  
  11621.  
  11622.  
  11623.      TCHK 2.0                                               Page 176
  11624.  
  11625.   
  11626.   Function             read_attrib - gets the attribute under the cursor
  11627.   
  11628.   Syntax              byte read_attrib(void);
  11629.   
  11630.   Prototype in        video.h
  11631.   
  11632.   Remarks             gets the attribute under the cursor via INT 0x10,
  11633.                       Function 9.
  11634.   
  11635.   Return value        returns the attribute under the cursor.
  11636.   
  11637.   See also            read_char()
  11638.   
  11639.   
  11640.  
  11641.  
  11642.  
  11643.  
  11644.  
  11645.  
  11646.  
  11647.  
  11648.  
  11649.  
  11650.  
  11651.  
  11652.  
  11653.  
  11654.  
  11655.  
  11656.  
  11657.  
  11658.  
  11659.  
  11660.  
  11661.  
  11662.  
  11663.  
  11664.  
  11665.  
  11666.  
  11667.  
  11668.  
  11669.  
  11670.  
  11671.  
  11672.  
  11673.  
  11674.  
  11675.  
  11676.  
  11677.  
  11678.  
  11679.  
  11680.  
  11681.  
  11682.  
  11683.  
  11684.  
  11685.  
  11686.  
  11687.  
  11688.  
  11689.      TCHK 2.0                                               Page 177
  11690.  
  11691.   
  11692.   Function             read_char - gets the character under the cursor
  11693.   
  11694.   Syntax              byte read_char(void);
  11695.   
  11696.   Prototype in        video.h
  11697.   
  11698.   Remarks             gets the character under the cursor via INT 0x10,
  11699.                       Function 9.
  11700.   
  11701.   Return value        returns the character under the cursor.
  11702.   
  11703.   See also            read_attrib()
  11704.   
  11705.   
  11706.  
  11707.  
  11708.  
  11709.  
  11710.  
  11711.  
  11712.  
  11713.  
  11714.  
  11715.  
  11716.  
  11717.  
  11718.  
  11719.  
  11720.  
  11721.  
  11722.  
  11723.  
  11724.  
  11725.  
  11726.  
  11727.  
  11728.  
  11729.  
  11730.  
  11731.  
  11732.  
  11733.  
  11734.  
  11735.  
  11736.  
  11737.  
  11738.  
  11739.  
  11740.  
  11741.  
  11742.  
  11743.  
  11744.  
  11745.  
  11746.  
  11747.  
  11748.  
  11749.  
  11750.  
  11751.  
  11752.  
  11753.  
  11754.  
  11755.      TCHK 2.0                                               Page 178
  11756.  
  11757.   
  11758.   Function             read_cursor - reads cursor information
  11759.   
  11760.   Syntax              unsigned int read_cursor(int *row, int *col);
  11761.   
  11762.   Prototype in        video.h
  11763.   
  11764.   Remarks             reads the cursor location and scan lines via
  11765.                       INTerrupts.
  11766.   
  11767.   Return value        returns the scan lines of the cursor as a word, the
  11768.                       high order byte the start and low order byte the
  11769.                       end.
  11770.   
  11771.   See also            cursor_blink(), cursor_flip(), cursor_off(),
  11772.                       cursor_on(), getcursor(), set_cursor(),
  11773.                       setcursor(), whereh(), wherev()
  11774.   
  11775.   Example             #include <video.h>
  11776.   
  11777.                       main()
  11778.                       {
  11779.                            int x,y;
  11780.                            unsigned int scan;
  11781.   
  11782.                            scan = read_cursor(&x,&y);
  11783.                            printf("Scan start %d and end %d\n",
  11784.                                 scan&0xFF00, scan&0xFF);
  11785.                       }
  11786.   
  11787.   Program output      Scan start 6 and end 7         /* on CGA */
  11788.   
  11789.  
  11790.  
  11791.  
  11792.  
  11793.  
  11794.  
  11795.  
  11796.  
  11797.  
  11798.  
  11799.  
  11800.  
  11801.  
  11802.  
  11803.  
  11804.  
  11805.  
  11806.  
  11807.  
  11808.  
  11809.  
  11810.  
  11811.  
  11812.  
  11813.  
  11814.  
  11815.  
  11816.  
  11817.  
  11818.  
  11819.  
  11820.  
  11821.      TCHK 2.0                                               Page 179
  11822.  
  11823.   
  11824.   Function             read_mode - find screen width, mode and page
  11825.   
  11826.   Syntax              void read_mode(byte *width, byte *mode,
  11827.                                      byte *page);
  11828.   
  11829.   Prototype in        video.h
  11830.   
  11831.   Remarks             detects the screen width (number of columns,) video
  11832.                       mode and video page via INT 0x10, Service 0x0F.
  11833.   
  11834.   Return value        nothing.
  11835.   
  11836.   See also            video.h
  11837.                       set_mode()
  11838.   
  11839.   Example             #include <video.h>
  11840.   
  11841.                       main()
  11842.                       {
  11843.                            byte width, mode, page;
  11844.   
  11845.                            read_mode(&width, &mode, &page);
  11846.                            printf("# columns: %d  Mode: %d  Page: %d\n",
  11847.                                   width, mode, page);
  11848.                       }
  11849.   
  11850.   Program output      # columns: 80    Mode: 3   Page: 1
  11851.   
  11852.  
  11853.  
  11854.  
  11855.  
  11856.  
  11857.  
  11858.  
  11859.  
  11860.  
  11861.  
  11862.  
  11863.  
  11864.  
  11865.  
  11866.  
  11867.  
  11868.  
  11869.  
  11870.  
  11871.  
  11872.  
  11873.  
  11874.  
  11875.  
  11876.  
  11877.  
  11878.  
  11879.  
  11880.  
  11881.  
  11882.  
  11883.  
  11884.  
  11885.  
  11886.  
  11887.      TCHK 2.0                                               Page 180
  11888.  
  11889.   
  11890.   Function             reboot - reboots the machine
  11891.   
  11892.   Syntax              void reboot(boolean warmboot);
  11893.   
  11894.   Prototype in        ibm.h
  11895.   
  11896.   Remarks             calling this function will reboot your machine via
  11897.                       the ROM reboot code located at F000:000. You can
  11898.                       specify a warm or cold boot (like hitting
  11899.                       CTRL-ALT-DEL or turning the power on.)
  11900.   
  11901.   Return value        nothing.
  11902.   
  11903.   Example             #include <ibm.h>
  11904.   
  11905.                       main()
  11906.                       {
  11907.                            boolean bootstyle;
  11908.   
  11909.                            /* set bootstyle */
  11910.                            reboot(bootstyle);
  11911.                       }
  11912.   
  11913.  
  11914.  
  11915.  
  11916.  
  11917.  
  11918.  
  11919.  
  11920.  
  11921.  
  11922.  
  11923.  
  11924.  
  11925.  
  11926.  
  11927.  
  11928.  
  11929.  
  11930.  
  11931.  
  11932.  
  11933.  
  11934.  
  11935.  
  11936.  
  11937.  
  11938.  
  11939.  
  11940.  
  11941.  
  11942.  
  11943.  
  11944.  
  11945.  
  11946.  
  11947.  
  11948.  
  11949.  
  11950.  
  11951.  
  11952.  
  11953.      TCHK 2.0                                               Page 181
  11954.  
  11955.   
  11956.   Function             rightstr - return the right portion of a string
  11957.   
  11958.   Syntax              char *rightstr(char *source, int len);
  11959.   
  11960.   Prototype in        stringhk.h
  11961.   
  11962.   Remarks             rightstr performs just like its BASIC counterpart
  11963.                       MID$().
  11964.   
  11965.                       rightstr returns the middle part of a string.
  11966.   
  11967.   Return value        rightstr returns the rightmost len characters of
  11968.                       source. If the length of source is less than len,
  11969.                       the entire string is returned.
  11970.   
  11971.                       rightstr returns a pointer to the storage location
  11972.                       containing the new string, or NULL if space could
  11973.                       not be allocated.
  11974.   
  11975.   See also            leftstr(), midstr()
  11976.   
  11977.   Example             #include <stringhk.h>
  11978.                       #include <stdio.h>            /* for the printf */
  11979.   
  11980.                       main()
  11981.                       {
  11982.                            char msg[25], *r;
  11983.   
  11984.                            strcpy(msg,"This is another test");
  11985.                            r = right(msg,7);
  11986.                            printf("%s\n",msg);
  11987.                            printf("%s\n",r);
  11988.                       }
  11989.   
  11990.   Program output      This is another test
  11991.                       er test
  11992.   
  11993.   
  11994.  
  11995.  
  11996.  
  11997.  
  11998.  
  11999.  
  12000.  
  12001.  
  12002.  
  12003.  
  12004.  
  12005.  
  12006.  
  12007.  
  12008.  
  12009.  
  12010.  
  12011.  
  12012.  
  12013.  
  12014.  
  12015.  
  12016.  
  12017.  
  12018.  
  12019.      TCHK 2.0                                               Page 182
  12020.  
  12021.   
  12022.   Function             ROM_date - gets the ROM id date
  12023.   
  12024.   Syntax              byte ROM_date(void);
  12025.   
  12026.   Prototype in        ibm.h
  12027.   
  12028.   Remarks             finds the ROM id date at F000:FFF5
  12029.   
  12030.   Return value        returns a pointer to the storage location
  12031.                       containing the string, or NULL if space could not
  12032.                       be allocated.
  12033.   
  12034.   See also            ibm.h
  12035.                       machine_id(), ROM_id()
  12036.   
  12037.   Example             #include <ibm.h>
  12038.                       #include <stdio.h>
  12039.   
  12040.                       main()
  12041.                       {
  12042.                            printf("ROM BIOS date = %s",ROM_date());
  12043.                       }
  12044.   
  12045.   Program output      ROM BIOS date = 06/10/85
  12046.   
  12047.  
  12048.  
  12049.  
  12050.  
  12051.  
  12052.  
  12053.  
  12054.  
  12055.  
  12056.  
  12057.  
  12058.  
  12059.  
  12060.  
  12061.  
  12062.  
  12063.  
  12064.  
  12065.  
  12066.  
  12067.  
  12068.  
  12069.  
  12070.  
  12071.  
  12072.  
  12073.  
  12074.  
  12075.  
  12076.  
  12077.  
  12078.  
  12079.  
  12080.  
  12081.  
  12082.  
  12083.  
  12084.  
  12085.      TCHK 2.0                                               Page 183
  12086.  
  12087.   
  12088.   Function             ROM_id - gets the ROM id byte
  12089.   
  12090.   Syntax              byte ROM_id(void);
  12091.   
  12092.   Prototype in        ibm.h
  12093.   
  12094.   Remarks             finds the ROM id byte at F000:FFFE
  12095.   
  12096.   Return value        returns the ROM id byte
  12097.   
  12098.   Note                on Compaq machines the ROM id byte is found at a
  12099.                       memory location close to, but not at, F000:FFFE.
  12100.                       Not having access to a Compaq, I did not include a
  12101.                       check for this. Maybe a future version...
  12102.   
  12103.   See also            ibm.h
  12104.                       machine_id(), ROM_date()
  12105.   
  12106.   Example             #include <ibm.h>
  12107.                       #include <stdio.h>
  12108.   
  12109.                       main()
  12110.                       {
  12111.                            printf("ROM id byte = %X",ROM_id());
  12112.                       }
  12113.   
  12114.   Program output      ROM id byte = FF
  12115.   
  12116.  
  12117.  
  12118.  
  12119.  
  12120.  
  12121.  
  12122.  
  12123.  
  12124.  
  12125.  
  12126.  
  12127.  
  12128.  
  12129.  
  12130.  
  12131.  
  12132.  
  12133.  
  12134.  
  12135.  
  12136.  
  12137.  
  12138.  
  12139.  
  12140.  
  12141.  
  12142.  
  12143.  
  12144.  
  12145.  
  12146.  
  12147.  
  12148.  
  12149.  
  12150.  
  12151.      TCHK 2.0                                               Page 184
  12152.  
  12153.   
  12154.   Function             round - round a real to a decimal place
  12155.   
  12156.   Syntax              double round(double x, int n);
  12157.   
  12158.   Prototype in        mathhk.h
  12159.   
  12160.   Remarks             round will round off a double to x amount of
  12161.                       decimal places. Only zero or greater values are
  12162.                       valid for n (non-zegative). No error checking is
  12163.                       done.
  12164.   
  12165.   Return value        returns x rounded to n decimal places.
  12166.   
  12167.   See also            frac()
  12168.   
  12169.   Example             #include <mathhk.h>
  12170.   
  12171.                       main()
  12172.                       {
  12173.                            printf("Round %lf to %d places = %lf\n",2.307,
  12174.                                   2,round(2.307,2));
  12175.   
  12176.   Program output      Round 2.307 to 2 places = 2.31
  12177.   
  12178.   Example             see demonum.c
  12179.   
  12180.   
  12181.  
  12182.  
  12183.  
  12184.  
  12185.  
  12186.  
  12187.  
  12188.  
  12189.  
  12190.  
  12191.  
  12192.  
  12193.  
  12194.  
  12195.  
  12196.  
  12197.  
  12198.  
  12199.  
  12200.  
  12201.  
  12202.  
  12203.  
  12204.  
  12205.  
  12206.  
  12207.  
  12208.  
  12209.  
  12210.  
  12211.  
  12212.  
  12213.  
  12214.  
  12215.  
  12216.  
  12217.      TCHK 2.0                                               Page 185
  12218.  
  12219.   
  12220.   Function             rtrim - trims trailing blanks
  12221.   
  12222.   Syntax              char *rtrim(char *source);
  12223.   
  12224.   Prototype in        stringhk.h
  12225.   
  12226.   Remarks             removes trailing blanks in a string. The string
  12227.                       passed to rtrim (source) is modified.
  12228.   
  12229.   Return value        returns a pointer to source.
  12230.   
  12231.   Example             #include <stringhk.h>
  12232.                       #include <stdio.h>            /* for the printf */
  12233.   
  12234.                       main()
  12235.                       {
  12236.                            char msg[25] = "  Hello everyone   ";
  12237.                            printf("String [%s]\n",msg);
  12238.                            printf("rtrim  [%s]\n",rtrim(msg));
  12239.                       }
  12240.        
  12241.   Program output      String [  Hello everyone   ]
  12242.                       rtrim  [  Hello everyone]
  12243.   
  12244.   
  12245.  
  12246.  
  12247.  
  12248.  
  12249.  
  12250.  
  12251.  
  12252.  
  12253.  
  12254.  
  12255.  
  12256.  
  12257.  
  12258.  
  12259.  
  12260.  
  12261.  
  12262.  
  12263.  
  12264.  
  12265.  
  12266.  
  12267.  
  12268.  
  12269.  
  12270.  
  12271.  
  12272.  
  12273.  
  12274.  
  12275.  
  12276.  
  12277.  
  12278.  
  12279.  
  12280.  
  12281.  
  12282.  
  12283.      TCHK 2.0                                               Page 186
  12284.  
  12285.   
  12286.   Function             scrbuff - calculate size of screen buffer
  12287.   
  12288.   Syntax              #include <video.h>
  12289.                       scrbuff(l,t,r,b)
  12290.   
  12291.   Prototype in        video.h
  12292.   
  12293.   Remarks             this is really just a define to calculate the size
  12294.                       of a buffer need by Borland's gettext() and
  12295.                       puttext() functions.
  12296.   
  12297.   Return value        returns the number of bytes needed to store a
  12298.                       segment of screen from (l,t) to (r,b), with
  12299.                       attributes.
  12300.   
  12301.   See also            video.h
  12302.   
  12303.  
  12304.  
  12305.  
  12306.  
  12307.  
  12308.  
  12309.  
  12310.  
  12311.  
  12312.  
  12313.  
  12314.  
  12315.  
  12316.  
  12317.  
  12318.  
  12319.  
  12320.  
  12321.  
  12322.  
  12323.  
  12324.  
  12325.  
  12326.  
  12327.  
  12328.  
  12329.  
  12330.  
  12331.  
  12332.  
  12333.  
  12334.  
  12335.  
  12336.  
  12337.  
  12338.  
  12339.  
  12340.  
  12341.  
  12342.  
  12343.  
  12344.  
  12345.  
  12346.  
  12347.  
  12348.  
  12349.      TCHK 2.0                                               Page 187
  12350.  
  12351.   
  12352.   Function             scroll_down - scroll window down
  12353.   
  12354.   Syntax              void scroll_down(int left, int top, int right,
  12355.                                        int bottom);
  12356.   
  12357.   Prototype in        video.h
  12358.   
  12359.   Remarks             scroll a box, delineated by the coordinates, down 1
  12360.                       line. A blank line will be inserted at the top, and
  12361.                       the bottom line will be lost. The scrolling is done
  12362.                       via INT 0x10, Function 7. Coordinates are absolute.
  12363.   
  12364.   Return value        nothing.
  12365.   
  12366.   See also            scroll_up()
  12367.   
  12368.   Example             #include <video.h>
  12369.   
  12370.                       main()
  12371.                       {
  12372.                            scroll_down(0,0,4,79);
  12373.                            /* scroll bottom 4 lines */
  12374.                       }
  12375.   
  12376.   
  12377.  
  12378.  
  12379.  
  12380.  
  12381.  
  12382.  
  12383.  
  12384.  
  12385.  
  12386.  
  12387.  
  12388.  
  12389.  
  12390.  
  12391.  
  12392.  
  12393.  
  12394.  
  12395.  
  12396.  
  12397.  
  12398.  
  12399.  
  12400.  
  12401.  
  12402.  
  12403.  
  12404.  
  12405.  
  12406.  
  12407.  
  12408.  
  12409.  
  12410.  
  12411.  
  12412.  
  12413.  
  12414.  
  12415.      TCHK 2.0                                               Page 188
  12416.  
  12417.   
  12418.   Function             scroll_up - scroll window up
  12419.   
  12420.   Syntax              void scroll_up(int left, int top, int right,
  12421.                                        int bottom);
  12422.   
  12423.   Prototype in        video.h
  12424.   
  12425.   Remarks             scroll a box, delineated by the coordinates, up 1
  12426.                       line. A blank line will be inserted at the bottom,
  12427.                       and the top line will be lost. The scrolling is
  12428.                       done via INT 0x10, Function 6. Coordinates are
  12429.                       absolute.
  12430.   
  12431.   Return value        nothing.
  12432.   
  12433.   See also            scroll_down()
  12434.   
  12435.   Example             #include <video.h>
  12436.   
  12437.                       main()
  12438.                       {
  12439.                            scroll_up(0,0,4,79); /* scroll top 4 lines */
  12440.                       }
  12441.   
  12442.   
  12443.  
  12444.  
  12445.  
  12446.  
  12447.  
  12448.  
  12449.  
  12450.  
  12451.  
  12452.  
  12453.  
  12454.  
  12455.  
  12456.  
  12457.  
  12458.  
  12459.  
  12460.  
  12461.  
  12462.  
  12463.  
  12464.  
  12465.  
  12466.  
  12467.  
  12468.  
  12469.  
  12470.  
  12471.  
  12472.  
  12473.  
  12474.  
  12475.  
  12476.  
  12477.  
  12478.  
  12479.  
  12480.  
  12481.      TCHK 2.0                                               Page 189
  12482.  
  12483.   
  12484.   Function             ScrollLock - set the Scroll Lock key state
  12485.   
  12486.   Syntax              void ScrollLock(boolean on);
  12487.   
  12488.   Prototype in        ibm.h
  12489.   
  12490.   Remarks             sets the Scroll Lock key state to the state
  12491.                       selected by the on parameter.
  12492.   
  12493.   Return value        nothing.
  12494.   
  12495.   See also            CapsLock(), InsLock(), NumLock()
  12496.   
  12497.  
  12498.  
  12499.  
  12500.  
  12501.  
  12502.  
  12503.  
  12504.  
  12505.  
  12506.  
  12507.  
  12508.  
  12509.  
  12510.  
  12511.  
  12512.  
  12513.  
  12514.  
  12515.  
  12516.  
  12517.  
  12518.  
  12519.  
  12520.  
  12521.  
  12522.  
  12523.  
  12524.  
  12525.  
  12526.  
  12527.  
  12528.  
  12529.  
  12530.  
  12531.  
  12532.  
  12533.  
  12534.  
  12535.  
  12536.  
  12537.  
  12538.  
  12539.  
  12540.  
  12541.  
  12542.  
  12543.  
  12544.  
  12545.  
  12546.  
  12547.      TCHK 2.0                                               Page 190
  12548.  
  12549.   
  12550.   Function             set_color - set the default attribute (color)
  12551.   
  12552.   Syntax              void set_color(byte colors);
  12553.   
  12554.   Prototype in        video.h
  12555.   
  12556.   Remarks             set_color just sets the global variable
  12557.                       char_attribute to colors. I got tired of declaring
  12558.                       char_attribute as extern in every function that
  12559.                       output to the screen, so I made this function.
  12560.   
  12561.   Return value        nothing.
  12562.   
  12563.   See also            putk(), putstr()
  12564.   
  12565.   Example             #include <video.h>
  12566.                       #include <color.h>
  12567.   
  12568.                       main()
  12569.                       {
  12570.                            set_color(RED | B_WHITE | BLINK);
  12571.                            /* red blinking text on white background */
  12572.                            gotoxy(12,40);
  12573.                            putstr((byte *)"Hello");
  12574.                       }
  12575.   
  12576.   
  12577.  
  12578.  
  12579.  
  12580.  
  12581.  
  12582.  
  12583.  
  12584.  
  12585.  
  12586.  
  12587.  
  12588.  
  12589.  
  12590.  
  12591.  
  12592.  
  12593.  
  12594.  
  12595.  
  12596.  
  12597.  
  12598.  
  12599.  
  12600.  
  12601.  
  12602.  
  12603.  
  12604.  
  12605.  
  12606.  
  12607.  
  12608.  
  12609.  
  12610.  
  12611.  
  12612.  
  12613.      TCHK 2.0                                               Page 191
  12614.  
  12615.   
  12616.   Function             set_cursor - sets cursor scan lines
  12617.   
  12618.   Syntax              #include <video.h>
  12619.                       set_cursor(h,l)
  12620.   
  12621.   Prototype in        video.h
  12622.   
  12623.   Remarks             sets the cursor scan lines via setcursor(), passing
  12624.                       h | l as the cursor scan code.
  12625.   
  12626.                       This function is a macro.
  12627.   
  12628.   Return value        nothing.
  12629.   
  12630.   See also            cursor_blink(), cursor_flip(), cursor_off(),
  12631.                       cursor_on(), getcursor(), read_cursor(),
  12632.                       setcursor()
  12633.   
  12634.   Example             #include <video.h>
  12635.   
  12636.                       main()
  12637.                       {
  12638.                            set_cursor(0,7);
  12639.                       }
  12640.   
  12641.   
  12642.  
  12643.  
  12644.  
  12645.  
  12646.  
  12647.  
  12648.  
  12649.  
  12650.  
  12651.  
  12652.  
  12653.  
  12654.  
  12655.  
  12656.  
  12657.  
  12658.  
  12659.  
  12660.  
  12661.  
  12662.  
  12663.  
  12664.  
  12665.  
  12666.  
  12667.  
  12668.  
  12669.  
  12670.  
  12671.  
  12672.  
  12673.  
  12674.  
  12675.  
  12676.  
  12677.  
  12678.  
  12679.      TCHK 2.0                                               Page 192
  12680.  
  12681.   
  12682.   Function             set_handles - set handle count
  12683.   
  12684.   Syntax              int set_handles(int handles);
  12685.   
  12686.   Prototype in        filehk.h
  12687.   
  12688.   Remarks             sets the handle count via DOS Function 0x67. If
  12689.                       more than 255 handles are specified (the maximum
  12690.                       allowable) set_handle tries to set the handle count
  12691.                       to 255.
  12692.   
  12693.   Return value        returns zero if execution was successful, a nonzero
  12694.                       error code otherwise.
  12695.   
  12696.   Note                This function requires DOS 3.3+.
  12697.   
  12698.   Example             #include <filehk.h>
  12699.   
  12700.                       main()
  12701.                       {
  12702.                            set_handles(127);
  12703.                       }
  12704.   
  12705.  
  12706.  
  12707.  
  12708.  
  12709.  
  12710.  
  12711.  
  12712.  
  12713.  
  12714.  
  12715.  
  12716.  
  12717.  
  12718.  
  12719.  
  12720.  
  12721.  
  12722.  
  12723.  
  12724.  
  12725.  
  12726.  
  12727.  
  12728.  
  12729.  
  12730.  
  12731.  
  12732.  
  12733.  
  12734.  
  12735.  
  12736.  
  12737.  
  12738.  
  12739.  
  12740.  
  12741.  
  12742.  
  12743.  
  12744.  
  12745.      TCHK 2.0                                               Page 193
  12746.  
  12747.   
  12748.   Function             set_mode - set the video mode
  12749.   
  12750.   Syntax              void set_mode(byte mode);
  12751.   
  12752.   Prototype in        video.h
  12753.   
  12754.   Remarks             sets the video mode via INT 0x10, Service 0.
  12755.   
  12756.   Return value        nothing.
  12757.   
  12758.   See also            video.h
  12759.                       read_mode()
  12760.   
  12761.   Example             #include <video.h>
  12762.   
  12763.                       main()
  12764.                       {
  12765.                            set_mode(3);        /* text mode */
  12766.                            printf("# columns: %d    Mode: %d   Page:
  12767.                                 %d\n", width, mode, page);
  12768.                       }
  12769.   
  12770.   Program output      # columns: 80    Mode: 3   Page: 1
  12771.   
  12772.   
  12773.  
  12774.  
  12775.  
  12776.  
  12777.  
  12778.  
  12779.  
  12780.  
  12781.  
  12782.  
  12783.  
  12784.  
  12785.  
  12786.  
  12787.  
  12788.  
  12789.  
  12790.  
  12791.  
  12792.  
  12793.  
  12794.  
  12795.  
  12796.  
  12797.  
  12798.  
  12799.  
  12800.  
  12801.  
  12802.  
  12803.  
  12804.  
  12805.  
  12806.  
  12807.  
  12808.  
  12809.  
  12810.  
  12811.      TCHK 2.0                                               Page 194
  12812.  
  12813.   
  12814.   Function             setBREAK - set Ctrl-BREAK flag
  12815.   
  12816.   Syntax              #include <ibm.h>
  12817.                       boolean setBREAK(boolean break_status);
  12818.   
  12819.   Prototype in        ibm.h
  12820.   
  12821.   Remarks             sets the state of the Ctrl-BREAK flag. The BREAK
  12822.                       status flag can be set from DOS by BREAK ON or
  12823.                       BREAK OFF.
  12824.   
  12825.                       This function is a macro.
  12826.   
  12827.   Return value        returns TRUE if the break flag is on, FALSE if the
  12828.                       flag is off.
  12829.   
  12830.   Note                the return value is based on the CURRENT setting.
  12831.                       If you set the break flag, setBREAK will return
  12832.                       what you set the flag to, not what the flag was set
  12833.                       to before.
  12834.   
  12835.   See also            isBREAKon(), isVERIFYon(), setVERIFY()
  12836.   
  12837.   Example             #include <ibm.h>
  12838.   
  12839.                       main()
  12840.                       {
  12841.                            printf("BREAK flag was ");
  12842.                            if (! setBREAK(TRUE))
  12843.                                 printf("not ");
  12844.                            printf("on\n");
  12845.                       }
  12846.   
  12847.  
  12848.  
  12849.  
  12850.  
  12851.  
  12852.  
  12853.  
  12854.  
  12855.  
  12856.  
  12857.  
  12858.  
  12859.  
  12860.  
  12861.  
  12862.  
  12863.  
  12864.  
  12865.  
  12866.  
  12867.  
  12868.  
  12869.  
  12870.  
  12871.  
  12872.  
  12873.  
  12874.  
  12875.  
  12876.  
  12877.      TCHK 2.0                                               Page 195
  12878.  
  12879.   
  12880.   Function             setcursor - sets cursor scan lines
  12881.   
  12882.   Syntax              void set_cursor(unsigned int cursor);
  12883.   
  12884.   Prototype in        video.h
  12885.   
  12886.   Remarks             sets the cursor scan lines via INT 0x10, Function
  12887.                       1.
  12888.   
  12889.   Return value        nothing.
  12890.   
  12891.   See also            cursor_blink(), cursor_flip(), cursor_off(),
  12892.                       cursor_on(), getcursor(), read_cursor(),
  12893.                       set_cursor()
  12894.   
  12895.   Example             #include <video.h>
  12896.   
  12897.                       main()
  12898.                       {
  12899.                            setcursor(7);
  12900.                       }
  12901.   
  12902.   
  12903.  
  12904.  
  12905.  
  12906.  
  12907.  
  12908.  
  12909.  
  12910.  
  12911.  
  12912.  
  12913.  
  12914.  
  12915.  
  12916.  
  12917.  
  12918.  
  12919.  
  12920.  
  12921.  
  12922.  
  12923.  
  12924.  
  12925.  
  12926.  
  12927.  
  12928.  
  12929.  
  12930.  
  12931.  
  12932.  
  12933.  
  12934.  
  12935.  
  12936.  
  12937.  
  12938.  
  12939.  
  12940.  
  12941.  
  12942.  
  12943.      TCHK 2.0                                               Page 196
  12944.  
  12945.   
  12946.   Function             settextinfo - set text mode video information
  12947.   
  12948.   Syntax              void settextinfo(struct text_info *inforec);
  12949.   
  12950.   Prototype in        video.h
  12951.   
  12952.   Remarks             settextinfo sets the Borland internal text mode
  12953.                       settings to the values in the text_info structure
  12954.                       pointed to by inforec, in the following order:
  12955.   
  12956.                            mode                (via textmode())
  12957.                            window              (via window())
  12958.                            attribute           (via textattr())
  12959.                            cursor location     (via gotoxy())
  12960.   
  12961.                       Only those settings needed to be modified are
  12962.                       actually changed.
  12963.   
  12964.                       This function does the exact opposite of
  12965.                       gettextinfo(), and was designed to be used in
  12966.                       conjunction with it. Do a gettextinfo() to save the
  12967.                       current settings, do whatever, then restore the
  12968.                       settings via settextinfo().
  12969.   
  12970.   Return value        nothing.
  12971.   
  12972.   
  12973.  
  12974.  
  12975.  
  12976.  
  12977.  
  12978.  
  12979.  
  12980.  
  12981.  
  12982.  
  12983.  
  12984.  
  12985.  
  12986.  
  12987.  
  12988.  
  12989.  
  12990.  
  12991.  
  12992.  
  12993.  
  12994.  
  12995.  
  12996.  
  12997.  
  12998.  
  12999.  
  13000.  
  13001.  
  13002.  
  13003.  
  13004.  
  13005.  
  13006.  
  13007.  
  13008.  
  13009.      TCHK 2.0                                               Page 197
  13010.  
  13011.   
  13012.   Function             setVERIFY - set VERIFY flag
  13013.   
  13014.   Syntax              #include <ibm.h>
  13015.                       boolean setVERIFY(boolean verify_status);
  13016.   
  13017.   Prototype in        ibm.h
  13018.   
  13019.   Remarks             sets the state of the verify flag. The VERIFY
  13020.                       status flag can be set from DOS by VERIFY ON or
  13021.                       VERIFY OFF.
  13022.   
  13023.                       This function is a macro.
  13024.   
  13025.   Return value        returns TRUE if the verify flag is on, FALSE if the
  13026.                       flag is off.
  13027.   
  13028.   Note                the return value is based on the CURRENT setting.
  13029.                       If you set the verify flag, setVERIFY will return
  13030.                       what you set the flag to, not what the flag was set
  13031.                       to before.
  13032.   
  13033.   See also            isBREAKon(), isVERIFYon(), setBREAK()
  13034.   
  13035.   Example             #include <ibm.h>
  13036.   
  13037.                       main()
  13038.                       {
  13039.                            printf("VERIFY flag was ");
  13040.                            if (! setVERIFY(TRUE))
  13041.                                 printf("not ");
  13042.                            printf("on\n");
  13043.                       }
  13044.   
  13045.  
  13046.  
  13047.  
  13048.  
  13049.  
  13050.  
  13051.  
  13052.  
  13053.  
  13054.  
  13055.  
  13056.  
  13057.  
  13058.  
  13059.  
  13060.  
  13061.  
  13062.  
  13063.  
  13064.  
  13065.  
  13066.  
  13067.  
  13068.  
  13069.  
  13070.  
  13071.  
  13072.  
  13073.  
  13074.  
  13075.      TCHK 2.0                                               Page 198
  13076.  
  13077.   
  13078.   Function             shorttoddate - convert a short date to struct
  13079.   
  13080.   Syntax              struct ddate *shorttoddate(char *source);
  13081.   
  13082.   Prototype in        datehk.h
  13083.   
  13084.   Remarks             shorttoddate converts a date from a short date
  13085.                       format to the structure ddate format
  13086.   
  13087.   Return value        returns a pointer to the storage location
  13088.                       containing the date structure, or NULL if space
  13089.                       could not be allocated.
  13090.   
  13091.   See also            see Appendix A
  13092.                       Cal...(), date_convert(), ddatetofull(),
  13093.                       ddatetoshort(), ddatetostr(), fulltoddate(),
  13094.                       Greg...(), Jul...(), monthexpand(), strtoddate()
  13095.   
  13096.   Example             see demodate.c
  13097.   
  13098.  
  13099.  
  13100.  
  13101.  
  13102.  
  13103.  
  13104.  
  13105.  
  13106.  
  13107.  
  13108.  
  13109.  
  13110.  
  13111.  
  13112.  
  13113.  
  13114.  
  13115.  
  13116.  
  13117.  
  13118.  
  13119.  
  13120.  
  13121.  
  13122.  
  13123.  
  13124.  
  13125.  
  13126.  
  13127.  
  13128.  
  13129.  
  13130.  
  13131.  
  13132.  
  13133.  
  13134.  
  13135.  
  13136.  
  13137.  
  13138.  
  13139.  
  13140.  
  13141.      TCHK 2.0                                               Page 199
  13142.  
  13143.   
  13144.   Function             sqr - square of a value
  13145.   
  13146.   Syntax              #include <mathhk.h>
  13147.                       (type) sqr(x)
  13148.   
  13149.   Prototype in        mathhk.h
  13150.   
  13151.   Remarks             sqr will calculate the square of x.
  13152.   
  13153.                       This function is a macro.
  13154.   
  13155.   Return value        returns the square of x.
  13156.   
  13157.   
  13158.  
  13159.  
  13160.  
  13161.  
  13162.  
  13163.  
  13164.  
  13165.  
  13166.  
  13167.  
  13168.  
  13169.  
  13170.  
  13171.  
  13172.  
  13173.  
  13174.  
  13175.  
  13176.  
  13177.  
  13178.  
  13179.  
  13180.  
  13181.  
  13182.  
  13183.  
  13184.  
  13185.  
  13186.  
  13187.  
  13188.  
  13189.  
  13190.  
  13191.  
  13192.  
  13193.  
  13194.  
  13195.  
  13196.  
  13197.  
  13198.  
  13199.  
  13200.  
  13201.  
  13202.  
  13203.  
  13204.  
  13205.  
  13206.  
  13207.      TCHK 2.0                                               Page 200
  13208.  
  13209.   
  13210.   Function             stddev - calculate the standard deviation of a
  13211.                                  set of reals
  13212.   
  13213.   Syntax              double stddev(int n, double element[]);
  13214.   
  13215.   Prototype in        mathhk.h
  13216.   
  13217.   Remarks             variance calculates the standard deviation of a set
  13218.                       of n numbers of type double.
  13219.   
  13220.   Return value        returns the standard deviation of a set of n
  13221.                       numbers.
  13222.   
  13223.   See also            average(), summation(), variance()
  13224.   
  13225.   Example             #include <mathhk.h>
  13226.   
  13227.                       main()
  13228.                       {
  13229.                            double num[] = { 2.3, 7.1, 6.05 };
  13230.   
  13231.                            printf("Std dev is %.9lf\n",stddev(3,num));
  13232.                       }
  13233.   
  13234.   Program output      Std dev is 2.060339778
  13235.   
  13236.   
  13237.  
  13238.  
  13239.  
  13240.  
  13241.  
  13242.  
  13243.  
  13244.  
  13245.  
  13246.  
  13247.  
  13248.  
  13249.  
  13250.  
  13251.  
  13252.  
  13253.  
  13254.  
  13255.  
  13256.  
  13257.  
  13258.  
  13259.  
  13260.  
  13261.  
  13262.  
  13263.  
  13264.  
  13265.  
  13266.  
  13267.  
  13268.  
  13269.  
  13270.  
  13271.  
  13272.  
  13273.      TCHK 2.0                                               Page 201
  13274.  
  13275.   
  13276.   Function             straight_line_dep - calculate straight line
  13277.                                             depreciation
  13278.   
  13279.   Syntax              double straight_line_dep(double cost, double 
  13280.                                                salvage, int life);
  13281.   
  13282.   Prototype in        finance.h
  13283.   
  13284.   Remarks             given the cost, salvage value and life of an item,
  13285.                       straight_line_dep will calculate the periodic
  13286.                       deprecitation according to the straight line method
  13287.                       of depreciation. The cost and salvage can be given
  13288.                       in any unit (dollars, thousands of dollars, etc.)
  13289.                       but the life should be given in depreciable periods
  13290.                       (if you depreciate an item every quarter, and the
  13291.                       item has a life of 2 years, then life should be 8.)
  13292.   
  13293.                       The cost and salvage values should be in the same
  13294.                       units.
  13295.   
  13296.                       No error checking is performed.
  13297.   
  13298.   Return value        returns the periodic depreciation in the same units
  13299.                       as the cost, as per the straight line depreciation
  13300.                       method.
  13301.   
  13302.   Note                The macro SLD(c,s,l) is defined in finance.h for
  13303.                       ease of use.
  13304.   
  13305.   See also            accum_dep(), depreciation(),
  13306.                       double_decline_bal_dep(), sum_year_digits_dep()
  13307.   
  13308.   Example             see demonum.c
  13309.   
  13310.   
  13311.  
  13312.  
  13313.  
  13314.  
  13315.  
  13316.  
  13317.  
  13318.  
  13319.  
  13320.  
  13321.  
  13322.  
  13323.  
  13324.  
  13325.  
  13326.  
  13327.  
  13328.  
  13329.  
  13330.  
  13331.  
  13332.  
  13333.  
  13334.  
  13335.  
  13336.  
  13337.  
  13338.  
  13339.      TCHK 2.0                                               Page 202
  13340.  
  13341.   
  13342.   Function             strcapital - capitalizes the first letter of each
  13343.                                      word in a string
  13344.   
  13345.   Syntax              char *strcapital(char *str);
  13346.   
  13347.   Prototype in        stringhk.h
  13348.   
  13349.   Remarks             strcapital capitalizes the first letter of each
  13350.                       word in the string str. A word is defined an an
  13351.                       alphabetic sequence of letters. The string passed
  13352.                       to strcapital is modified.
  13353.   
  13354.   Return value        returns str.
  13355.   
  13356.   
  13357.  
  13358.  
  13359.  
  13360.  
  13361.  
  13362.  
  13363.  
  13364.  
  13365.  
  13366.  
  13367.  
  13368.  
  13369.  
  13370.  
  13371.  
  13372.  
  13373.  
  13374.  
  13375.  
  13376.  
  13377.  
  13378.  
  13379.  
  13380.  
  13381.  
  13382.  
  13383.  
  13384.  
  13385.  
  13386.  
  13387.  
  13388.  
  13389.  
  13390.  
  13391.  
  13392.  
  13393.  
  13394.  
  13395.  
  13396.  
  13397.  
  13398.  
  13399.  
  13400.  
  13401.  
  13402.  
  13403.  
  13404.  
  13405.      TCHK 2.0                                               Page 203
  13406.  
  13407.   
  13408.   Function             strclean - remove non-printable ASCII codes
  13409.   
  13410.   Syntax              char *strclean(char *str);
  13411.   
  13412.   Prototype in        stringhk.h
  13413.   
  13414.   Remarks             strclean removes any non-printable ASCII characters
  13415.                       from the string str. Non-printable is defined as
  13416.                       per the isprint() function. The string passed to
  13417.                       strclean is modified.
  13418.   
  13419.   Return value        returns str.
  13420.   
  13421.   
  13422.  
  13423.  
  13424.  
  13425.  
  13426.  
  13427.  
  13428.  
  13429.  
  13430.  
  13431.  
  13432.  
  13433.  
  13434.  
  13435.  
  13436.  
  13437.  
  13438.  
  13439.  
  13440.  
  13441.  
  13442.  
  13443.  
  13444.  
  13445.  
  13446.  
  13447.  
  13448.  
  13449.  
  13450.  
  13451.  
  13452.  
  13453.  
  13454.  
  13455.  
  13456.  
  13457.  
  13458.  
  13459.  
  13460.  
  13461.  
  13462.  
  13463.  
  13464.  
  13465.  
  13466.  
  13467.  
  13468.  
  13469.  
  13470.  
  13471.      TCHK 2.0                                               Page 204
  13472.  
  13473.   
  13474.   Function             strcomma - convert a string to xx,xxx,xxx format
  13475.   
  13476.   Syntax              char *strcomma(char *source); 
  13477.   
  13478.   Prototype in        stringhk.h
  13479.   
  13480.   Remarks             strcomma converts a string of numbers into the
  13481.                       comma delimited format (xx,xxx,xxx). The number is
  13482.                       terminated by a non-digit (any character other than
  13483.                       0-9.) A leading sign will be copied before
  13484.                       converting the number.
  13485.   
  13486.   Return value        returns a pointer to the storage location
  13487.                       containing the comma formatted string, or NULL if
  13488.                       space could not be allocated. The returned string
  13489.                       is NOT the same as the string passed to the
  13490.                       function. This function does NOT write over the
  13491.                       string passed to it.
  13492.   
  13493.   See also            strtocomma()
  13494.   
  13495.   Example             #include <stringhk.h>
  13496.                       #include <stdio.h>            /* for the printf */
  13497.   
  13498.                       main()
  13499.                       {
  13500.                            char sint[15], *comma;
  13501.   
  13502.                            strcpy(sint,"12839.44");
  13503.                            comma = strcomma(sint);
  13504.                            printf("%s -> %s\n",sint,comma);
  13505.                       }
  13506.        
  13507.   Program output      12839.44 -> 12,839.44
  13508.   
  13509.   
  13510.  
  13511.  
  13512.  
  13513.  
  13514.  
  13515.  
  13516.  
  13517.  
  13518.  
  13519.  
  13520.  
  13521.  
  13522.  
  13523.  
  13524.  
  13525.  
  13526.  
  13527.  
  13528.  
  13529.  
  13530.  
  13531.  
  13532.  
  13533.  
  13534.  
  13535.  
  13536.  
  13537.      TCHK 2.0                                               Page 205
  13538.  
  13539.   
  13540.   Function             strdel - delete part of a string
  13541.   
  13542.   Syntax              char *strdel(char *source, char *old);
  13543.   
  13544.   Prototype in        stringhk.h
  13545.   
  13546.   Remarks             strdel deletes the first occurence of the string
  13547.                       old from the string source. This function is case
  13548.                       dependent.
  13549.   
  13550.   Return value        returns source
  13551.   
  13552.   Example             #include <stringhk.h>
  13553.                       #include <stdio.h>            /* for the printf */
  13554.   
  13555.                       main()
  13556.                       {
  13557.                            char msg[45], fragment[15], *new;
  13558.   
  13559.                            strcpy(msg,"Did you register yet? Did you?");
  13560.                            strcpy(fragment,"you");
  13561.                            printf("  [%s]\n",msg);
  13562.                            printf("- [%s]\n",fragment);
  13563.                            new = strdel(msg,fragment);
  13564.                            printf("= [%s]\n",new);
  13565.                       }
  13566.   
  13567.   Program output        [Did you register yet? Did you?]
  13568.                       - [you]
  13569.                       = [Did  register yet? Did you?]
  13570.   
  13571.   
  13572.  
  13573.  
  13574.  
  13575.  
  13576.  
  13577.  
  13578.  
  13579.  
  13580.  
  13581.  
  13582.  
  13583.  
  13584.  
  13585.  
  13586.  
  13587.  
  13588.  
  13589.  
  13590.  
  13591.  
  13592.  
  13593.  
  13594.  
  13595.  
  13596.  
  13597.  
  13598.  
  13599.  
  13600.  
  13601.  
  13602.  
  13603.      TCHK 2.0                                               Page 206
  13604.  
  13605.   
  13606.   Function             strfill - fill a string with a character
  13607.   
  13608.   Syntax              char *strfill(char *str, char c, int count);
  13609.   
  13610.   Prototype in        stringhk.h
  13611.   
  13612.   Remarks             strfill makes a string of c characters of count
  13613.                       length.
  13614.   
  13615.                       Similar to strrep(), strfill() uses an existing
  13616.                       piece of memory pointed to by str. Functions like
  13617.                       strnset set a piece of memory with a character, but
  13618.                       do not make it a valid C string (null terminated.)
  13619.   
  13620.   Return value        returns the pointer passed to strfill.
  13621.   
  13622.   See also            strrep()
  13623.   
  13624.  
  13625.  
  13626.  
  13627.  
  13628.  
  13629.  
  13630.  
  13631.  
  13632.  
  13633.  
  13634.  
  13635.  
  13636.  
  13637.  
  13638.  
  13639.  
  13640.  
  13641.  
  13642.  
  13643.  
  13644.  
  13645.  
  13646.  
  13647.  
  13648.  
  13649.  
  13650.  
  13651.  
  13652.  
  13653.  
  13654.  
  13655.  
  13656.  
  13657.  
  13658.  
  13659.  
  13660.  
  13661.  
  13662.  
  13663.  
  13664.  
  13665.  
  13666.  
  13667.  
  13668.  
  13669.      TCHK 2.0                                               Page 207
  13670.  
  13671.   
  13672.   Function             strins - insert one string into another
  13673.   
  13674.   Syntax              char *strins(char *source, char *new, char *ptr);
  13675.   
  13676.   Prototype in        stringhk.h
  13677.   
  13678.   Remarks             strins inserts the string new into the string
  13679.                       source at the location ptr in source. Basically,
  13680.                       strins copies source up to, but not including, ptr
  13681.                       into a new location, concatenates the new
  13682.                       (inserted) string, and then concatenates the
  13683.                       remainder of source (the string pointed to by ptr.)
  13684.   
  13685.   Return value        returns a pointer to the storage location
  13686.                       containing the newly concatenated string, or NULL
  13687.                       if space could not be allocated. The returned
  13688.                       string is NOT the same as the string passed to the
  13689.                       function. This function does NOT write over the
  13690.                       string passed to it.
  13691.   
  13692.   Example             #include <stringhk.h>
  13693.                       #include <stdio.h>            /* for the printf */
  13694.   
  13695.                       main()
  13696.                       {
  13697.                            char old[25], *ptr, *new;
  13698.   
  13699.                            strcpy(old,"ABCDEFG");
  13700.                            ptr = old + 3;            /* *ptr = 'D' */
  13701.                            new = strins(old,"abc",ptr);
  13702.                            printf("%s -> %s\n",old,new);
  13703.                       }
  13704.   
  13705.   Program output      ABCDEDFG -> ABCabcDEFG
  13706.   
  13707.   
  13708.  
  13709.  
  13710.  
  13711.  
  13712.  
  13713.  
  13714.  
  13715.  
  13716.  
  13717.  
  13718.  
  13719.  
  13720.  
  13721.  
  13722.  
  13723.  
  13724.  
  13725.  
  13726.  
  13727.  
  13728.  
  13729.  
  13730.  
  13731.  
  13732.  
  13733.  
  13734.  
  13735.      TCHK 2.0                                               Page 208
  13736.  
  13737.   
  13738.   Function             stroccur - count the occurences of a substring
  13739.                                    within a string
  13740.   
  13741.   Syntax              int stroccur(str *str, char *substr);
  13742.   
  13743.   Prototype in        stringhk.h
  13744.   
  13745.   Remarks             stroccur counts the number of times the string
  13746.                       substr appears with the string str.
  13747.   
  13748.   Return value        returns the number of times the string substr
  13749.                       appears within the string str.
  13750.   
  13751.   Example             #include <stringhk.h>
  13752.                       #include <stdio.h>            /* for the printf */
  13753.   
  13754.                       main()
  13755.                       {
  13756.                            char original[] = "This is his test";
  13757.   
  13758.                            printf("%d\n",stroccur(original,"is"));
  13759.                       }
  13760.   
  13761.   Program output      3
  13762.   
  13763.   
  13764.  
  13765.  
  13766.  
  13767.  
  13768.  
  13769.  
  13770.  
  13771.  
  13772.  
  13773.  
  13774.  
  13775.  
  13776.  
  13777.  
  13778.  
  13779.  
  13780.  
  13781.  
  13782.  
  13783.  
  13784.  
  13785.  
  13786.  
  13787.  
  13788.  
  13789.  
  13790.  
  13791.  
  13792.  
  13793.  
  13794.  
  13795.  
  13796.  
  13797.  
  13798.  
  13799.  
  13800.  
  13801.      TCHK 2.0                                               Page 209
  13802.  
  13803.   
  13804.   Function             strrep - replicate a char
  13805.   
  13806.   Syntax              char *strrep(char c, int len);
  13807.   
  13808.   Prototype in        stringhk.h
  13809.   
  13810.   Remarks             strrep creates a string len long entirely of
  13811.                       character c.
  13812.   
  13813.   Return value        returns a pointer to the storage location
  13814.                       containing the newly replicated string, or NULL if
  13815.                       space could not be allocated.
  13816.   
  13817.   Example             #include <stringhk.h>
  13818.                       #include <stdio.h>            /* for the printf */
  13819.   
  13820.                       main()
  13821.                       {
  13822.                            char *rep;
  13823.   
  13824.                            printf("%s\n",rep = strrep('k',7));
  13825.                       }
  13826.   
  13827.   Program output      kkkkkkk
  13828.   
  13829.   
  13830.  
  13831.  
  13832.  
  13833.  
  13834.  
  13835.  
  13836.  
  13837.  
  13838.  
  13839.  
  13840.  
  13841.  
  13842.  
  13843.  
  13844.  
  13845.  
  13846.  
  13847.  
  13848.  
  13849.  
  13850.  
  13851.  
  13852.  
  13853.  
  13854.  
  13855.  
  13856.  
  13857.  
  13858.  
  13859.  
  13860.  
  13861.  
  13862.  
  13863.  
  13864.  
  13865.  
  13866.  
  13867.      TCHK 2.0                                               Page 210
  13868.  
  13869.   
  13870.   Function             strshleft - shift string left
  13871.   
  13872.   Syntax              void strshleft(char *source, int count);
  13873.   
  13874.   Prototype in        stringhk.h
  13875.   
  13876.   Remarks             strshleft shifts the characters in the string
  13877.                       source left count places, padding with spaces.
  13878.   
  13879.   Return value        returns source.
  13880.   
  13881.   Example             #include <stringhk.h>
  13882.                       #include <stdio.h>            /* for the printf */
  13883.   
  13884.                       main()
  13885.                       {
  13886.                            char msg[25];
  13887.   
  13888.                            strcpy(msg,"Buy a Mac II");
  13889.                            printf("%s\n",msg);
  13890.                            printf("%s\n",strshleft(msg,4));
  13891.                       }
  13892.   
  13893.   Program output      Buy a Mac II
  13894.                       a Mac II
  13895.   
  13896.   
  13897.  
  13898.  
  13899.  
  13900.  
  13901.  
  13902.  
  13903.  
  13904.  
  13905.  
  13906.  
  13907.  
  13908.  
  13909.  
  13910.  
  13911.  
  13912.  
  13913.  
  13914.  
  13915.  
  13916.  
  13917.  
  13918.  
  13919.  
  13920.  
  13921.  
  13922.  
  13923.  
  13924.  
  13925.  
  13926.  
  13927.  
  13928.  
  13929.  
  13930.  
  13931.  
  13932.  
  13933.      TCHK 2.0                                               Page 211
  13934.  
  13935.   
  13936.   Function             strshright - shift string right
  13937.   
  13938.   Syntax              void strshright(char *source, int count);
  13939.   
  13940.   Prototype in        stringhk.h
  13941.   
  13942.   Remarks             strchright shifts the characters in the string
  13943.                       source right count places, padding with spaces.
  13944.   
  13945.   Return value        returns source.
  13946.   
  13947.   Example             #include <stringhk.h>
  13948.                       #include <stdio.h>            /* for the printf */
  13949.   
  13950.                       main()
  13951.                       {
  13952.                            char msg[25];
  13953.   
  13954.                            strcpy(msg,"Buy a Mac II");
  13955.                            printf("%s\n",msg);
  13956.                            printf("%s\n",strshright(msg,4));
  13957.                       }
  13958.   
  13959.   Program output      Buy a Mac II
  13960.                           Buy a Ma
  13961.   
  13962.   
  13963.  
  13964.  
  13965.  
  13966.  
  13967.  
  13968.  
  13969.  
  13970.  
  13971.  
  13972.  
  13973.  
  13974.  
  13975.  
  13976.  
  13977.  
  13978.  
  13979.  
  13980.  
  13981.  
  13982.  
  13983.  
  13984.  
  13985.  
  13986.  
  13987.  
  13988.  
  13989.  
  13990.  
  13991.  
  13992.  
  13993.  
  13994.  
  13995.  
  13996.  
  13997.  
  13998.  
  13999.      TCHK 2.0                                               Page 212
  14000.  
  14001.   
  14002.   Function             strtocomma - convert a string to xx,xxx format
  14003.   
  14004.   Syntax              char *strtocomma(char *source); 
  14005.   
  14006.   Prototype in        stringhk.h
  14007.   
  14008.   Remarks             strtocomma converts a string of numbers into the
  14009.                       comma delimited format (xx,xxx,xxx). The number is
  14010.                       terminated by a non-digit (any character other than
  14011.                       0-9.) A leading sign will be copied before
  14012.                       converting the number.
  14013.   
  14014.                       The comma delimited string will be returned in
  14015.                       source, so you must make sure there is sufficient
  14016.                       space allocated.
  14017.   
  14018.   Return value        returns a pointer to source. This function writes
  14019.                       over the string passed to it.
  14020.   
  14021.   See also            strcomma()
  14022.   
  14023.   Example             #include <stringhk.h>
  14024.                       #include <stdio.h>            /* for the printf */
  14025.   
  14026.                       main()
  14027.                       {
  14028.                            char temp[15];
  14029.   
  14030.                            strcpy(temp,"12839.44");
  14031.                            printf("-> %s\n",strtocomma(temp));
  14032.                       }
  14033.        
  14034.   Program output      -> 12,839.44
  14035.   
  14036.   
  14037.  
  14038.  
  14039.  
  14040.  
  14041.  
  14042.  
  14043.  
  14044.  
  14045.  
  14046.  
  14047.  
  14048.  
  14049.  
  14050.  
  14051.  
  14052.  
  14053.  
  14054.  
  14055.  
  14056.  
  14057.  
  14058.  
  14059.  
  14060.  
  14061.  
  14062.  
  14063.  
  14064.  
  14065.      TCHK 2.0                                               Page 213
  14066.  
  14067.   
  14068.   Function             strtoddate - convert a date string to a structure
  14069.   
  14070.   Syntax              struct ddate *strtoddate(char *source); 
  14071.   
  14072.   Prototype in        datehk.h
  14073.   
  14074.   Remarks             strtoddate converts a date abbreviation to a
  14075.                       structure of type ddate. The abbreviation can use
  14076.                       dashes or slashes (- or /) to separate the fields
  14077.                       of the date. All fields MUST be of length two (i.e.
  14078.                       02/07/87 is valid, but 2/7/87 and 02/07/1987 are
  14079.                       not valid.)
  14080.   
  14081.   Return value        returns a pointer to the storage location
  14082.                       containing the date structure, or NULL if space
  14083.                       could not be allocated.
  14084.   
  14085.   See also            Cal...(), date_convert(), ddatetofull(),
  14086.                       ddatetoshort(), ddatetostr(), fulltoddate(),
  14087.                       Greg...(), Jul...(), monthexpand(), shorttoddate()
  14088.   
  14089.   Example             #include <datehk.h>
  14090.   
  14091.                       main()
  14092.                       {
  14093.                            struct ddate *today;
  14094.                            char strtoday[9];
  14095.   
  14096.                            strcpy(strtoday,"04/01/67");
  14097.                            if ((today = strtoddate(strtoday) != NULL) {
  14098.                                 printf("today is %d-%d-%d\n",
  14099.                                      today->dmon, today->dday,
  14100.                                      today->dyear);
  14101.                                 printf("or %s\n", strtoday);
  14102.                            }
  14103.                       }
  14104.   
  14105.   Program output      today is 4-1-67
  14106.                       or 04/01/67
  14107.   
  14108.   
  14109.  
  14110.  
  14111.  
  14112.  
  14113.  
  14114.  
  14115.  
  14116.  
  14117.  
  14118.  
  14119.  
  14120.  
  14121.  
  14122.  
  14123.  
  14124.  
  14125.  
  14126.  
  14127.  
  14128.  
  14129.  
  14130.  
  14131.      TCHK 2.0                                               Page 214
  14132.  
  14133.   
  14134.   Function             strtodol - converts a string to dollar format
  14135.   
  14136.   Syntax              char *strtodol(char *source); 
  14137.   
  14138.   Prototype in        stringhk.h
  14139.   
  14140.   Remarks             strtodol converts a string pointed to by source to
  14141.                       dollar format ($-12,839.44). An optional leading
  14142.                       sign is copied. Only the first 2 decimal places are
  14143.                       copied (the string is truncated, not rounded.) 
  14144.   
  14145.   Return value        returns a pointer to the storage location
  14146.                       containing the dollar formatted string, or NULL if
  14147.                       space could not be allocated. The returned string
  14148.                       is NOT the same as the string passed to the
  14149.                       function. This function does NOT write over the
  14150.                       string passed to it.
  14151.   
  14152.   Example             #include <stringhk.h>
  14153.                       #include <stdio.h>            /* for the printf */
  14154.   
  14155.                       main()
  14156.                       {
  14157.                            char sint[15], *dollar
  14158.   
  14159.                            strcpy(sint,"12839.44");
  14160.                            dollar = strtodol(sint);
  14161.                            printf("%s -> %s\n",sint,dollar);
  14162.                            free(dollar);
  14163.                            strcpy(sint,"+62939445.1");
  14164.                            dollar = strtodol(sint);
  14165.                            printf("%s -> %s\n",sint,dollar);
  14166.                            free(dollar);
  14167.                       }
  14168.        
  14169.   Program output      12839.44 -> $12,839.44
  14170.                       +62939445.1 -> $+62,939,445.10
  14171.   
  14172.   
  14173.  
  14174.  
  14175.  
  14176.  
  14177.  
  14178.  
  14179.  
  14180.  
  14181.  
  14182.  
  14183.  
  14184.  
  14185.  
  14186.  
  14187.  
  14188.  
  14189.  
  14190.  
  14191.  
  14192.  
  14193.  
  14194.  
  14195.  
  14196.  
  14197.      TCHK 2.0                                               Page 215
  14198.  
  14199.   
  14200.   Function             strtotime - convert a string to a time structure
  14201.   
  14202.   Syntax              struct time *strtotime(char *source);
  14203.   
  14204.   Prototype in        timehk.h
  14205.   
  14206.   Remarks             strtotime converts a string to a time structure,
  14207.                       checking for AM/PM or 24-hour format. If seconds or
  14208.                       hundredths of seconds are not in the string, their
  14209.                       values will be set to 0 in the structure.
  14210.   
  14211.   Return value        returns a pointer to the storage location
  14212.                       containing the time string, or NULL if space could
  14213.                       not be allocated.
  14214.   
  14215.   See also            timetostr()
  14216.   
  14217.   Example             #include <timehk.h>
  14218.   
  14219.                       main()
  14220.                       {
  14221.                            struct time *now;
  14222.   
  14223.                            strcpy(strnow,"5:12 PM");
  14224.                            if ((now = strtotime(strnow)) != NULL)
  14225.                                 printf("%d hours, %d min, %d.%d secs\n",
  14226.                                      now->ti_hour, now->ti_min,
  14227.                                      now->ti_sec, now->ti_hund);
  14228.                       }
  14229.   
  14230.   Program output      17 hours, 12 min, 0.0 secs
  14231.   
  14232.  
  14233.  
  14234.  
  14235.  
  14236.  
  14237.  
  14238.  
  14239.  
  14240.  
  14241.  
  14242.  
  14243.  
  14244.  
  14245.  
  14246.  
  14247.  
  14248.  
  14249.  
  14250.  
  14251.  
  14252.  
  14253.  
  14254.  
  14255.  
  14256.  
  14257.  
  14258.  
  14259.  
  14260.  
  14261.  
  14262.  
  14263.      TCHK 2.0                                               Page 216
  14264.  
  14265.   
  14266.   Function             strwcmp - compares a wild-carded string to
  14267.                                   another string
  14268.   
  14269.   Syntax              int strwcmp(char *wstr, char *str);
  14270.   
  14271.   Prototype in        stringhk.h
  14272.   
  14273.   Remarks             strwcmp performs an unsigned comparison of wstr and
  14274.                       str, starting with the first character in each
  14275.                       string and continuing with subsequent characters
  14276.                       until the corresponding characters differ or until
  14277.                       the end of the strings is reached. Wildcards (*,?)
  14278.                       are supported, as per DOS (* wildcards 0 or more
  14279.                       characters, ? wildcards a single character).
  14280.   
  14281.   Return value        strwcmp returns an int value that is
  14282.   
  14283.                            < 0       if wstr is less than str
  14284.                            = 0       if wstr is the same as str
  14285.                            > 0       if wstr is greater than str
  14286.   
  14287.                       Furthermore, if a comparison falls through during a
  14288.                       wildcard matching, -2 or 2 is returned. If a
  14289.                       mismatch is found without using wildcards, a -1 or
  14290.                       1 is returned.
  14291.   
  14292.   See also            strwicmp()
  14293.   
  14294.  
  14295.  
  14296.  
  14297.  
  14298.  
  14299.  
  14300.  
  14301.  
  14302.  
  14303.  
  14304.  
  14305.  
  14306.  
  14307.  
  14308.  
  14309.  
  14310.  
  14311.  
  14312.  
  14313.  
  14314.  
  14315.  
  14316.  
  14317.  
  14318.  
  14319.  
  14320.  
  14321.  
  14322.  
  14323.  
  14324.  
  14325.  
  14326.  
  14327.  
  14328.  
  14329.      TCHK 2.0                                               Page 217
  14330.  
  14331.   
  14332.   Function             strwicmp - compares a wild-carded string to
  14333.                                    another string, without case
  14334.                                    sensitivity
  14335.   
  14336.   Syntax              int strwicmp(char *wstr, char *str);
  14337.   
  14338.   Prototype in        stringhk.h
  14339.   
  14340.   Remarks             strwicmp performs an unsigned comparison of wstr
  14341.                       and str, starting with the first character in each
  14342.                       string and continuing with subsequent characters
  14343.                       until the corresponding characters differ or until
  14344.                       the end of the strings is reached. Wildcards (*,?)
  14345.                       are supported, as per DOS (* wildcards 0 or more
  14346.                       characters, ? wildcards a single character). The
  14347.                       comparison is not case sensitive.
  14348.   
  14349.   Return value        strwicmp returns a value that is
  14350.   
  14351.                            < 0       if wstr is less than str
  14352.                            = 0       if wstr is the same as str
  14353.                            > 0       if wstr is greater than str
  14354.   
  14355.                       Furthermore, if a comparison falls through during a
  14356.                       wildcard matching, -2 or 2 is returned. If a
  14357.                       mismatch is found without using wildcards, a -1 or
  14358.                       1 is returned.
  14359.   
  14360.   See also            strwcmp()
  14361.   
  14362.  
  14363.  
  14364.  
  14365.  
  14366.  
  14367.  
  14368.  
  14369.  
  14370.  
  14371.  
  14372.  
  14373.  
  14374.  
  14375.  
  14376.  
  14377.  
  14378.  
  14379.  
  14380.  
  14381.  
  14382.  
  14383.  
  14384.  
  14385.  
  14386.  
  14387.  
  14388.  
  14389.  
  14390.  
  14391.  
  14392.  
  14393.  
  14394.  
  14395.      TCHK 2.0                                               Page 218
  14396.  
  14397.   
  14398.   Function             sum_year_digits_dep - calculate sum of the years
  14399.                                                digits depreciation
  14400.   
  14401.   Syntax              double sum_year_digits_dep(double cost, double
  14402.                                      salvage, int life, int period);
  14403.   
  14404.   Prototype in        finance.h
  14405.   
  14406.   Remarks             given the cost, salvage value and life of an item,
  14407.                       sum_year_digits_dep will calculate the amount of
  14408.                       deprecitation for the given period according to the
  14409.                       sum of the years digits depreciation method. The
  14410.                       cost and salvage can be given in any unit (dollars,
  14411.                       thousands of dollars, etc.) but the life should be
  14412.                       given in depreciable periods (if you depreciate an
  14413.                       item every quarter, and the item has a life of 2
  14414.                       years, then life should be 8).
  14415.   
  14416.                       The cost and salvage values should be in the same
  14417.                       units. The life and period should be given in the
  14418.                       same units.
  14419.   
  14420.                       No error checking is performed.
  14421.   
  14422.   Return value        returns the amount of depreciation for the given
  14423.                       period in the same units as the cost, as per the
  14424.                       sum of the years digits depreciation method.
  14425.   
  14426.   Note                The macro SYD(c,s,l,p) is defined in finance.h for
  14427.                       ease of use.
  14428.   
  14429.   See also            accum_dep(), depreciation(),
  14430.                       double_decline_bal_dep(), straight_line_dep()
  14431.   
  14432.   Example             see demonum.c
  14433.   
  14434.   
  14435.  
  14436.  
  14437.  
  14438.  
  14439.  
  14440.  
  14441.  
  14442.  
  14443.  
  14444.  
  14445.  
  14446.  
  14447.  
  14448.  
  14449.  
  14450.  
  14451.  
  14452.  
  14453.  
  14454.  
  14455.  
  14456.  
  14457.  
  14458.  
  14459.  
  14460.  
  14461.      TCHK 2.0                                               Page 219
  14462.  
  14463.   
  14464.   Function             summation - calculate a summation of integers
  14465.   
  14466.   Syntax              int summation(int max);
  14467.   
  14468.   Prototype in        mathhk.h
  14469.   
  14470.   Remarks             summation calculates a summation denoted by Σ Xi
  14471.                       where i ranges from 1 to max. Beware of overflow,
  14472.                       calculations are done as ints.
  14473.   
  14474.   Return value        returns the summation denoted by Σ Xi where i
  14475.                       ranges from 1 to max. If max <= 1, summation
  14476.                       returns a 1.
  14477.   
  14478.   See also            average(), factorial(), stddev(), variance()
  14479.   
  14480.   Example             #include <mathhk.h>
  14481.   
  14482.                       main()
  14483.                       {
  14484.                            printf("Summation is %d\n",summation(10));
  14485.                       }
  14486.   
  14487.   Program output      Summation is 55
  14488.   
  14489.   
  14490.  
  14491.  
  14492.  
  14493.  
  14494.  
  14495.  
  14496.  
  14497.  
  14498.  
  14499.  
  14500.  
  14501.  
  14502.  
  14503.  
  14504.  
  14505.  
  14506.  
  14507.  
  14508.  
  14509.  
  14510.  
  14511.  
  14512.  
  14513.  
  14514.  
  14515.  
  14516.  
  14517.  
  14518.  
  14519.  
  14520.  
  14521.  
  14522.  
  14523.  
  14524.  
  14525.  
  14526.  
  14527.      TCHK 2.0                                               Page 220
  14528.  
  14529.   
  14530.   Function             swap - swap two values
  14531.   
  14532.   Syntax              #include <mathhk.h>
  14533.                       (void) swap(x,y)
  14534.   
  14535.   Prototype in        mathhk.h
  14536.   
  14537.   Remarks             swap will swap two values, regardless of type, but
  14538.                       should be of equal type.
  14539.   
  14540.                       This function is a macro.
  14541.   
  14542.   Return value        nothing.
  14543.   
  14544.   
  14545.  
  14546.  
  14547.  
  14548.  
  14549.  
  14550.  
  14551.  
  14552.  
  14553.  
  14554.  
  14555.  
  14556.  
  14557.  
  14558.  
  14559.  
  14560.  
  14561.  
  14562.  
  14563.  
  14564.  
  14565.  
  14566.  
  14567.  
  14568.  
  14569.  
  14570.  
  14571.  
  14572.  
  14573.  
  14574.  
  14575.  
  14576.  
  14577.  
  14578.  
  14579.  
  14580.  
  14581.  
  14582.  
  14583.  
  14584.  
  14585.  
  14586.  
  14587.  
  14588.  
  14589.  
  14590.  
  14591.  
  14592.  
  14593.      TCHK 2.0                                               Page 221
  14594.  
  14595.   
  14596.   Function             time_convert - convert time formats
  14597.   
  14598.   Syntax              boolean time_convert(void *source, void *dest,
  14599.                                            int stype, int dtype);
  14600.   
  14601.   Prototype in        timehk.h
  14602.   
  14603.   Remarks             time_convert will convert a time from virtually any
  14604.                       time format to any other. The parameters *source
  14605.                       and *dest must be pointers pointing to a piece of
  14606.                       memory allocated as the proper data type. stype and
  14607.                       dtype determine the format of source and dest.
  14608.   
  14609.                       Due to the great number of formats supported, a
  14610.                       chart of valid time formats is provided in Appendix
  14611.                       C.
  14612.   
  14613.                       Limited error checking is done on passed data. If
  14614.                       an invalid time format is passed, unpredictable
  14615.                       results will occur.
  14616.   
  14617.   Return value        returns TRUE is the conversion was successful and
  14618.                       FALSE if the time could not be converted.
  14619.   
  14620.   Note                This function does NO function calls. I've tried to
  14621.                       optimize this function as much as possible for
  14622.                       speed, not size. If you only need to convert
  14623.                       between a couple of specific formats, you may be
  14624.                       better off doing a pair of sprintfs.
  14625.   
  14626.   See also            Appendix C
  14627.                       strtotime(), timetostr()
  14628.   
  14629.   Example             see demotime.c
  14630.   
  14631.  
  14632.  
  14633.  
  14634.  
  14635.  
  14636.  
  14637.  
  14638.  
  14639.  
  14640.  
  14641.  
  14642.  
  14643.  
  14644.  
  14645.  
  14646.  
  14647.  
  14648.  
  14649.  
  14650.  
  14651.  
  14652.  
  14653.  
  14654.  
  14655.  
  14656.  
  14657.  
  14658.  
  14659.      TCHK 2.0                                               Page 222
  14660.  
  14661.   
  14662.   Function             timetostr - convert time structure to a string
  14663.   
  14664.   Syntax              char *timetostr(struct time *tsource,
  14665.                                       boolean seconds, boolean hundreds,
  14666.                                       boolean ampm);
  14667.   
  14668.   Prototype in        timehk.h
  14669.   
  14670.   Remarks             timetostr converts a time structure to a string,
  14671.                       with the following options:
  14672.   
  14673.                            seconds   = put seconds in string
  14674.                            hundreds  = put hundreths of seconds in string
  14675.                            ampm      = append AM/PM to string
  14676.   
  14677.                       if ampm is FALSE, 24-hour time will be used.
  14678.   
  14679.                       if hundreds is TRUE, seconds are automatically put
  14680.                       into the string.
  14681.   
  14682.   Return value        returns a pointer to the storage location
  14683.                       containing the time string, or NULL if space could
  14684.                       not be allocated.
  14685.   
  14686.   See also            strtotime()
  14687.   
  14688.   Example             #include <timehk.h>
  14689.   
  14690.                       main()
  14691.                       {
  14692.                            char *strnow;
  14693.                            struct time now;
  14694.   
  14695.                            gettime(&now);
  14696.                            if ((strnow = timetostr(&now, FALSE, TRUE,
  14697.                                                    TRUE)) != NULL)
  14698.                                 printf("The time is %s\n",strnow);
  14699.                       }
  14700.   
  14701.   Program output      The time is 11:23:14.22 PM
  14702.   
  14703.  
  14704.  
  14705.  
  14706.  
  14707.  
  14708.  
  14709.  
  14710.  
  14711.  
  14712.  
  14713.  
  14714.  
  14715.  
  14716.  
  14717.  
  14718.  
  14719.  
  14720.  
  14721.  
  14722.  
  14723.  
  14724.  
  14725.      TCHK 2.0                                               Page 223
  14726.  
  14727.   
  14728.   Function             tocapkey - convert the key code to uppercase
  14729.   
  14730.   Syntax              int tocapkey(int k);
  14731.   
  14732.   Prototype in        keyboard.h
  14733.   
  14734.   Remarks             if the key code k is a letter, it is converted to
  14735.                       upper case.
  14736.   
  14737.   Return value        if the key code is a lower case letter, tocapkey
  14738.                       returns the upper case of that letter, otherwise
  14739.                       tocapkey returns the key code unchanged
  14740.   
  14741.   See also            inkey(), inkeyc()
  14742.   
  14743.  
  14744.  
  14745.  
  14746.  
  14747.  
  14748.  
  14749.  
  14750.  
  14751.  
  14752.  
  14753.  
  14754.  
  14755.  
  14756.  
  14757.  
  14758.  
  14759.  
  14760.  
  14761.  
  14762.  
  14763.  
  14764.  
  14765.  
  14766.  
  14767.  
  14768.  
  14769.  
  14770.  
  14771.  
  14772.  
  14773.  
  14774.  
  14775.  
  14776.  
  14777.  
  14778.  
  14779.  
  14780.  
  14781.  
  14782.  
  14783.  
  14784.  
  14785.  
  14786.  
  14787.  
  14788.  
  14789.  
  14790.  
  14791.      TCHK 2.0                                               Page 224
  14792.  
  14793.   
  14794.   Function             to24hour - converts hours to 24-hour format
  14795.   
  14796.   Syntax              #include <timehk.h>
  14797.                       (int) to24hour(hr)
  14798.   
  14799.   Prototype in        timehk.h
  14800.   
  14801.   Remarks             converts midnight (0) to the 24th hour.
  14802.   
  14803.   Return value        returns 0 if hr is midnight (0), otherwise returns
  14804.                       hr.
  14805.   
  14806.   See also            isPM(), time_convert(), tohour()
  14807.   
  14808.   
  14809.  
  14810.  
  14811.  
  14812.  
  14813.  
  14814.  
  14815.  
  14816.  
  14817.  
  14818.  
  14819.  
  14820.  
  14821.  
  14822.  
  14823.  
  14824.  
  14825.  
  14826.  
  14827.  
  14828.  
  14829.  
  14830.  
  14831.  
  14832.  
  14833.  
  14834.  
  14835.  
  14836.  
  14837.  
  14838.  
  14839.  
  14840.  
  14841.  
  14842.  
  14843.  
  14844.  
  14845.  
  14846.  
  14847.  
  14848.  
  14849.  
  14850.  
  14851.  
  14852.  
  14853.  
  14854.  
  14855.  
  14856.  
  14857.      TCHK 2.0                                               Page 225
  14858.  
  14859.   
  14860.   Function             todosdate - make a DOS file date stamp
  14861.   
  14862.   Syntax              #include <doshk.h>
  14863.                       (unsigned) todosdate(y,m,d)
  14864.   
  14865.   Prototype in        doshk.h
  14866.   
  14867.   Remarks             makes a DOS file date stamp. Refer to a DOS
  14868.                       reference book (Advanced MS-DOS by Ray Duncan
  14869.                       recommended) for further details.
  14870.   
  14871.                       This function is a macro.
  14872.   
  14873.   Return value        returns the DOS file date stamp.
  14874.   
  14875.   See also            dosday(), doshour(), dosmonth(), dosmin(),
  14876.                       dossec(), dosyear(), todostime()
  14877.   
  14878.   
  14879.  
  14880.  
  14881.  
  14882.  
  14883.  
  14884.  
  14885.  
  14886.  
  14887.  
  14888.  
  14889.  
  14890.  
  14891.  
  14892.  
  14893.  
  14894.  
  14895.  
  14896.  
  14897.  
  14898.  
  14899.  
  14900.  
  14901.  
  14902.  
  14903.  
  14904.  
  14905.  
  14906.  
  14907.  
  14908.  
  14909.  
  14910.  
  14911.  
  14912.  
  14913.  
  14914.  
  14915.  
  14916.  
  14917.  
  14918.  
  14919.  
  14920.  
  14921.  
  14922.  
  14923.      TCHK 2.0                                               Page 226
  14924.  
  14925.   
  14926.   Function             todostime - make a DOS file time stamp
  14927.   
  14928.   Syntax              #include <doshk.h>
  14929.                       (unsigned) todostime(h,m,s)
  14930.   
  14931.   Prototype in        doshk.h
  14932.   
  14933.   Remarks             makes a DOS file time stamp. Refer to a DOS
  14934.                       reference book (Advanced MS-DOS by Ray Duncan
  14935.                       recommended) for further details.
  14936.   
  14937.                       This function is a macro.
  14938.   
  14939.   Return value        returns the DOS file time stamp.
  14940.   
  14941.   See also            dosday(), doshour(), dosmonth(), dosmin(),
  14942.                       dossec(), dosyear(), todosdate()
  14943.   
  14944.   
  14945.  
  14946.  
  14947.  
  14948.  
  14949.  
  14950.  
  14951.  
  14952.  
  14953.  
  14954.  
  14955.  
  14956.  
  14957.  
  14958.  
  14959.  
  14960.  
  14961.  
  14962.  
  14963.  
  14964.  
  14965.  
  14966.  
  14967.  
  14968.  
  14969.  
  14970.  
  14971.  
  14972.  
  14973.  
  14974.  
  14975.  
  14976.  
  14977.  
  14978.  
  14979.  
  14980.  
  14981.  
  14982.  
  14983.  
  14984.  
  14985.  
  14986.  
  14987.  
  14988.  
  14989.      TCHK 2.0                                               Page 227
  14990.  
  14991.   
  14992.   Function             tohour - converts 24-hour format to 12-hour
  14993.   
  14994.   Syntax              #include <timehk.h>
  14995.                       (int) tohour(hr)
  14996.   
  14997.   Prototype in        timehk.h
  14998.   
  14999.   Remarks             converts hr from 24-hour time to 12-hour time.
  15000.   
  15001.   Return value        returns the hour of the day, as would appear on a
  15002.                       12-hour clock (1-12).
  15003.   
  15004.   See also            isPM(), time_convert(), to24hour()
  15005.   
  15006.   
  15007.  
  15008.  
  15009.  
  15010.  
  15011.  
  15012.  
  15013.  
  15014.  
  15015.  
  15016.  
  15017.  
  15018.  
  15019.  
  15020.  
  15021.  
  15022.  
  15023.  
  15024.  
  15025.  
  15026.  
  15027.  
  15028.  
  15029.  
  15030.  
  15031.  
  15032.  
  15033.  
  15034.  
  15035.  
  15036.  
  15037.  
  15038.  
  15039.  
  15040.  
  15041.  
  15042.  
  15043.  
  15044.  
  15045.  
  15046.  
  15047.  
  15048.  
  15049.  
  15050.  
  15051.  
  15052.  
  15053.  
  15054.  
  15055.      TCHK 2.0                                               Page 228
  15056.  
  15057.   
  15058.   Function             valid_date - check if a date is valid
  15059.   
  15060.   Syntax              boolean valid_date(int month, int day, int
  15061.                       yearnum);
  15062.   
  15063.   Prototype in        datehk.h
  15064.   
  15065.   Remarks             valid_date checks if the given date is valid.
  15066.   
  15067.   Return value        returns TRUE if the date is valid, FALSE otherwise.
  15068.   
  15069.   See also            isleapyear()
  15070.   
  15071.   Example             #include <datehk.h>
  15072.   
  15073.                       main()
  15074.                       {
  15075.                            int i, d[3] = { 11,5,2 }, m[3] = { 31,12,29};
  15076.                            int y[3] = { 70, 1987, 1981 };
  15077.   
  15078.                            for (i=0; i<3; ++) {
  15079.                                 printf("%d/%d/%d  ", m[i], d[i], y[i]);
  15080.                                 if (valid_date(m[i], d[i], y[i])
  15081.                                      printf("valid\n");
  15082.                                 else
  15083.                                      printf("INVALID\n");
  15084.                            }
  15085.                       }
  15086.   
  15087.   Program output      11/31/70  INVALID        /* Nov has 30 days */
  15088.                       5/13/1987  valid
  15089.                       2/29/1981  INVALID       /* 1981 not a leap year */
  15090.   
  15091.  
  15092.  
  15093.  
  15094.  
  15095.  
  15096.  
  15097.  
  15098.  
  15099.  
  15100.  
  15101.  
  15102.  
  15103.  
  15104.  
  15105.  
  15106.  
  15107.  
  15108.  
  15109.  
  15110.  
  15111.  
  15112.  
  15113.  
  15114.  
  15115.  
  15116.  
  15117.  
  15118.  
  15119.  
  15120.  
  15121.      TCHK 2.0                                               Page 229
  15122.  
  15123.   
  15124.   Function             variance - calculate the variance of a set of
  15125.                                    reals
  15126.   
  15127.   Syntax              double variance(int n, double element[]);
  15128.   
  15129.   Prototype in        mathhk.h
  15130.   
  15131.   Remarks             variance calculates the variance of a set of n
  15132.                       numbers of type double.
  15133.   
  15134.   Return value        returns the variance of a set of n numbers.
  15135.   
  15136.   See also            average(), stddev(), summation()
  15137.   
  15138.   Example             #include <mathhk.h>
  15139.   
  15140.                       main()
  15141.                       {
  15142.                            double num[] = { 2.3, 7.1, 6.05 };
  15143.   
  15144.                            printf("Variance is %lf\n",variance(3,num));
  15145.                       }
  15146.   
  15147.   Program output      Variance is 4.245
  15148.   
  15149.   
  15150.  
  15151.  
  15152.  
  15153.  
  15154.  
  15155.  
  15156.  
  15157.  
  15158.  
  15159.  
  15160.  
  15161.  
  15162.  
  15163.  
  15164.  
  15165.  
  15166.  
  15167.  
  15168.  
  15169.  
  15170.  
  15171.  
  15172.  
  15173.  
  15174.  
  15175.  
  15176.  
  15177.  
  15178.  
  15179.  
  15180.  
  15181.  
  15182.  
  15183.  
  15184.  
  15185.  
  15186.  
  15187.      TCHK 2.0                                               Page 230
  15188.  
  15189.   
  15190.   Function             vert_line - draw a vertical line
  15191.   
  15192.   Syntax              void vert_line(byte c, int len, int col, int row);
  15193.   
  15194.   Prototype in        video.h
  15195.   
  15196.   Remarks             draws a vertical line of characters c of length len
  15197.                       beginning at (col,row) via INTerrupts, using the
  15198.                       current char_attribute setting for color. Screen
  15199.                       coordinates are absolute.
  15200.   
  15201.                       horiz_line does no error checking on the passed
  15202.                       parameters.
  15203.   
  15204.   Return value        nothing.
  15205.   
  15206.   See also            box(), horiz_line(), restore_box(),
  15207.                       restore_screen(), save_box(), save_screen()
  15208.   
  15209.   Example             #include <video.h>
  15210.   
  15211.                       main()
  15212.                       {
  15213.                            vert_line('*',7,4,4);    /* draw 7 *'s */
  15214.                       }
  15215.   
  15216.   
  15217.  
  15218.  
  15219.  
  15220.  
  15221.  
  15222.  
  15223.  
  15224.  
  15225.  
  15226.  
  15227.  
  15228.  
  15229.  
  15230.  
  15231.  
  15232.  
  15233.  
  15234.  
  15235.  
  15236.  
  15237.  
  15238.  
  15239.  
  15240.  
  15241.  
  15242.  
  15243.  
  15244.  
  15245.  
  15246.  
  15247.  
  15248.  
  15249.  
  15250.  
  15251.  
  15252.  
  15253.      TCHK 2.0                                               Page 231
  15254.  
  15255.   
  15256.   Function             whereh - X-coordinate of cursor 
  15257.   
  15258.   Syntax              int whereh(void);
  15259.   
  15260.   Prototype in        video.h
  15261.   
  15262.   Remarks             returns the X-coordinate (column) of the cursor's
  15263.                       current location via INT 0x10, Service 3.
  15264.   
  15265.   Return value        returns the X-coordinate of the cursor's current
  15266.                       location.
  15267.   
  15268.   See also            gotohv(), read_cursor(), wherev()
  15269.   
  15270.   Example             #include <video.h>
  15271.   
  15272.                       main()
  15273.                       {
  15274.                            printf("Cursor's column = %d\n",whereh());
  15275.                       }
  15276.   
  15277.   Program output      Cursor's column = 12
  15278.   
  15279.  
  15280.  
  15281.  
  15282.  
  15283.  
  15284.  
  15285.  
  15286.  
  15287.  
  15288.  
  15289.  
  15290.  
  15291.  
  15292.  
  15293.  
  15294.  
  15295.  
  15296.  
  15297.  
  15298.  
  15299.  
  15300.  
  15301.  
  15302.  
  15303.  
  15304.  
  15305.  
  15306.  
  15307.  
  15308.  
  15309.  
  15310.  
  15311.  
  15312.  
  15313.  
  15314.  
  15315.  
  15316.  
  15317.  
  15318.  
  15319.      TCHK 2.0                                               Page 232
  15320.  
  15321.   
  15322.   Function             wherev - Y-coordinate of cursor 
  15323.   
  15324.   Syntax              int wherey(void);
  15325.   
  15326.   Prototype in        video.h
  15327.   
  15328.   Remarks             returns the Y-coordinate (row) of the cursor's
  15329.                       current location via INT 0x10, Service 3.
  15330.   
  15331.   Return value        returns the Y-coordinate of the cursor's current
  15332.                       location.
  15333.   
  15334.   See also            gotohv(), read_cursor(), whereh()
  15335.   
  15336.   Example             #include <video.h>
  15337.   
  15338.                       main()
  15339.                       {
  15340.                            printf("Cursor's row = %d\n",wherev());
  15341.                       }
  15342.   
  15343.   Program output      Cursor's row = 4
  15344.   
  15345.  
  15346.  
  15347.  
  15348.  
  15349.  
  15350.  
  15351.  
  15352.  
  15353.  
  15354.  
  15355.  
  15356.  
  15357.  
  15358.  
  15359.  
  15360.  
  15361.  
  15362.  
  15363.  
  15364.  
  15365.  
  15366.  
  15367.  
  15368.  
  15369.  
  15370.  
  15371.  
  15372.  
  15373.  
  15374.  
  15375.  
  15376.  
  15377.  
  15378.  
  15379.  
  15380.  
  15381.  
  15382.  
  15383.  
  15384.  
  15385.      TCHK 2.0                                               Page 233
  15386.  
  15387.                                   #DEFINES
  15388.   
  15389.         Most of these #defines are self-explanatory. All can be found in
  15390.         the appropriate header files:
  15391.   
  15392.   
  15393.    Ansihk.h
  15394.   --------
  15395.   
  15396.        Ansi color definitions. See ansihk.h for more details
  15397.   
  15398.    Color.h
  15399.   -------
  15400.   
  15401.        DOS color definitions. See color.h for more details.
  15402.   
  15403.    Chiphk.h
  15404.   --------
  15405.   
  15406.        Cpu types recognized by cpu_id(). See chiphk.h for more details.
  15407.        Math coprocessor types recognized by ndp_id(). See chiphk.h for
  15408.             more details.
  15409.   
  15410.    Datehk.h
  15411.   --------
  15412.   
  15413.        Date types:
  15414.   
  15415.             typedef enum { Sun, Mon, Tues, Wed, Thrus, Fri, Sat } days;
  15416.             typedef enum { Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep,
  15417.                            Oct, Nov, Dec } months;
  15418.   
  15419.             My date structure:
  15420.   
  15421.                  typedef struct ddate {
  15422.                            int dyear;          /* Year - 1900 */
  15423.                            int dday;           /* Day of month (1-31) */
  15424.                            months dmon;        /* Month (Jan = 0) */
  15425.                       };
  15426.   
  15427.             Note: the year is stored as Year - 1900. For example, if you
  15428.                  wanted to store 1987 in the variable d (of type struct
  15429.                  ddate), you would:       d.dyear = 87;
  15430.             Note: the months start with January as zero.
  15431.   
  15432.        Date constants:
  15433.   
  15434.             #define DATENULL      "  -  -  "   /* empty date string */
  15435.             #define DATECHAR      '-'          /* date delimiter char */
  15436.             #define DATECHARSTR   "-"          /* date delim. string */
  15437.             #define DATECHARTEST  "/- "        /* all date delimiters */
  15438.             #define BASE_LEAP_YEAR  1980       /* base year for leap
  15439.                                                     year calculations */
  15440.             #define BASE_JUL_YEAR   1720982.0  /* base day for Julian
  15441.                                                     Type E calcs */
  15442.   
  15443.  
  15444.  
  15445.  
  15446.  
  15447.  
  15448.  
  15449.  
  15450.  
  15451.      TCHK 2.0                                               Page 234
  15452.  
  15453.   
  15454.        Date macros:
  15455.   
  15456.             #define isleap(yr)      isleapyear(yr)
  15457.   
  15458.    Doshk.h
  15459.   -------
  15460.   
  15461.        DOS types:
  15462.   
  15463.             typedef struct BIOSParmBlock {
  15464.                       unsigned int BytesPerSector;
  15465.                       byte         SectorsPerAllocUnit;
  15466.                       unsigned int ReservedSectors;
  15467.                       byte         numberFATs;
  15468.                       unsigned int numberRootDirEntries;
  15469.                       unsigned int TotalSectors;
  15470.                       byte         MediaDescriptor;
  15471.                       unsigned int SectorsPerFAT;
  15472.                  };
  15473.   
  15474.             typedef struct BootBlock {
  15475.                       byte JumpInstr[3];
  15476.                       byte OEMinfo[9];
  15477.                       struct BIOSParmBlock BPB;
  15478.                       unsigned int SectorsPerTrack;
  15479.                       unsigned int numberHeads;
  15480.                       unsigned int numberHiddenSectors;
  15481.                  };
  15482.   
  15483.    Filehk.h
  15484.   --------
  15485.   
  15486.        File types:
  15487.   
  15488.             typedef struct filespec {
  15489.                       char drive;
  15490.                       char path[81];
  15491.                       char filename[13];
  15492.                  };
  15493.             typedef struct fnameext {
  15494.                       char filename[9];
  15495.                       char ext[4];
  15496.                  };
  15497.   
  15498.        File constants:
  15499.   
  15500.             #define FNAMESIZE      96
  15501.             #define PATHSIZE      100
  15502.   
  15503.   
  15504.  
  15505.  
  15506.  
  15507.  
  15508.  
  15509.  
  15510.  
  15511.  
  15512.  
  15513.  
  15514.  
  15515.  
  15516.  
  15517.      TCHK 2.0                                               Page 235
  15518.  
  15519.    Finance.h
  15520.   ---------
  15521.   
  15522.        Finance macros:
  15523.   
  15524.             #define SLD(c,s,l)            straight_line_dep(c,s,l)
  15525.             #define SYD(c,s,l,p)          sum_year_digits_dep(c,s,l,p)
  15526.             #define DDB(c,l,p)            double_decline_bal_dep(c,l,p)
  15527.             #define ACC_SLD(c,s,l)        accum_dep(c,s,l,0,1)
  15528.             #define ACC_SYD(c,s,l,p)      accum_dep(c,s,l,p,2)
  15529.             #define ACC_DDB(c,l,p)        accum_dep(c,0,l,p,3)
  15530.   
  15531.   
  15532.    Howard.h
  15533.   --------
  15534.   
  15535.        Boolean constants and macros:
  15536.   
  15537.             #define boolean     char
  15538.             #define TRUE        1
  15539.             #define FALSE       0
  15540.             #define EQU(b1,b2)  (((b1)&&(b2)) || ((!b1)&&(!b2)))
  15541.             #define NEQ(b1,b2)  (((b1)&&(!b2)) || ((!b1)&&(b2)))
  15542.             #define BINV(b1)    (b1 ? FALSE : TRUE)
  15543.   
  15544.        Text justification:
  15545.   
  15546.             #define NONE        0
  15547.             #define LEFT        1
  15548.             #define CENTER      2
  15549.             #define RIGHT       3
  15550.   
  15551.    Ibm.h
  15552.   -----
  15553.   
  15554.        IBM types:
  15555.   
  15556.             typedef struct EMSrecord {
  15557.                       unsigned int handle;
  15558.                       unsigned int totalpages;
  15559.                       unsigned int availpages;
  15560.                       byte version;
  15561.                       byte emserror;
  15562.                  };
  15563.   
  15564.        IBM constants:
  15565.   
  15566.             Rom id constants. See ibm.h for more details.
  15567.             Machine id constants. See ibm.h for more details.
  15568.             Memory strategy constants. See ibm.h for more details.
  15569.             Disk id byte constants. See ibm.h for more details.
  15570.             EMS constants. See ibm.h for more details.
  15571.             #define TIMER_TICKS      *((long far *) 0x46Clu)
  15572.   
  15573.   
  15574.  
  15575.  
  15576.  
  15577.  
  15578.  
  15579.  
  15580.  
  15581.  
  15582.  
  15583.      TCHK 2.0                                               Page 236
  15584.  
  15585.    Keyboard.h
  15586.   ----------
  15587.   
  15588.        Keyboard constants:
  15589.   
  15590.             #define SHIFT_STATUS     *((byte far *) 0x417lu)
  15591.             #define WAITFORKEY       1
  15592.   
  15593.        getget() flags:
  15594.   
  15595.             #define BELL        0x08
  15596.             #define TRIMLEFT    0x04
  15597.             #define TRIMRIGHT   0x02
  15598.             #define INSERTMODE  0x01
  15599.             #define TRIMALL     TRIMLEFT|TRIMRIGHT
  15600.             #define NOFLAGS     0x00
  15601.   
  15602.        Keyboard macros:
  15603.   
  15604.             #define kbdclear()       clear_typeahead()
  15605.   
  15606.    Keycode.h
  15607.   ---------
  15608.   
  15609.        Keycode constants:
  15610.   
  15611.             Key shift status constants. See keycode.h for more details.
  15612.             Key code constants. See keycode.h for more details.
  15613.   
  15614.    Math.h
  15615.   ------
  15616.   
  15617.        Math constants:
  15618.   
  15619.             #define SQRT2       1.41421356237309504880
  15620.             #define PI          3.141592653589793238462643
  15621.             #define E           2.7182818284590452353602874
  15622.   
  15623.        Math functions:
  15624.   
  15625.             #define sqr(x)      ((x) * (x))
  15626.             #define isgn(x)     ((x) < 0 ? -1 : 1)
  15627.             #define lsgn(x)     ((x) < 0l ? -1 : 1)
  15628.             #define fsgn(x)     ((x) < 0.0 ? -1 : 1)
  15629.             #define sign(x)     isgn(x)
  15630.             #define sgn(x)      isgn(x)
  15631.             #define lsign(x)    lsgn(x)
  15632.             #define fsign(x)    fsgn(x)
  15633.             #define swap(x,y)   (x^=y, y^=x, x^=y)
  15634.             #define mid(a,x,b)  ((((a) <= (x)) && ((x) <= (b))) ? 1 : 0)
  15635.   
  15636.   
  15637.  
  15638.  
  15639.  
  15640.  
  15641.  
  15642.  
  15643.  
  15644.  
  15645.  
  15646.  
  15647.  
  15648.  
  15649.      TCHK 2.0                                               Page 237
  15650.  
  15651.    Menuhk.h
  15652.   --------
  15653.   
  15654.        Menuhk types:
  15655.   
  15656.             typedef struct popup_field {
  15657.                       char *command;
  15658.                       int y;
  15659.                       char flag;
  15660.                       char key;
  15661.                       char offset;
  15662.                       int retval;
  15663.                       struct popup_header *submenu;
  15664.                       struct popup_field *next;
  15665.                       struct popup_field *previous;
  15666.                  };
  15667.   
  15668.             typedef struct popup_header {
  15669.                       char *videosave;
  15670.                       struct text_info inforec;
  15671.                       int left, top, right, bottom;
  15672.                       int margc;
  15673.                       struct popup_field *margv;
  15674.                       struct popup_field *current;
  15675.                       char *menusave;
  15676.                       int colnorm;
  15677.                       int colcmdkey;
  15678.                       int colhilite;
  15679.                       int coldisabled;
  15680.                       int coldishilite;
  15681.                       unsigned flags;
  15682.                       char internal;
  15683.                  };
  15684.   
  15685.             typedef struct litebar_field {
  15686.                       char *command;
  15687.                       int x, y;
  15688.                       char flag;
  15689.                       char key;
  15690.                       char offset;
  15691.                       char *message;
  15692.                       int retval;
  15693.                       struct litebar_header *submenu;
  15694.                       struct litebar_field *next;
  15695.                       struct litebar_field *previous;
  15696.                       struct litebar_field *left;
  15697.                       struct litebar_field *right;
  15698.                       struct litebar_field *up;
  15699.                       struct litebar_field *down;
  15700.                  };
  15701.   
  15702.             typedef struct litebar_header {
  15703.                       char *videosave;
  15704.                       struct text_info inforec;
  15705.   
  15706.  
  15707.  
  15708.  
  15709.  
  15710.  
  15711.  
  15712.  
  15713.  
  15714.  
  15715.      TCHK 2.0                                               Page 238
  15716.  
  15717.                       int left, top, right, bottom;
  15718.                       int margc;
  15719.                       struct litebar_field *margv;
  15720.                       struct litebar_field *current;
  15721.                       int msgx, msgy;
  15722.                       char *menusave;
  15723.                       struct keylist *quitkey;
  15724.                       int colnorm;
  15725.                       int colcmdkey;
  15726.                       int colhilite;
  15727.                       int coldisabled;
  15728.                       int coldishilite;
  15729.                       int colmessage;
  15730.                       unsigned flags;
  15731.                       char internal;
  15732.                  };
  15733.   
  15734.             typedef struct keylist {
  15735.                       int keyval;
  15736.                       struct keylist *next;
  15737.                  };
  15738.   
  15739.        Menu flags:
  15740.   
  15741.             #define QUITMENU         0x8000
  15742.             #define ESCQUIT          0x4000
  15743.             #define FREEMENU         0x2000
  15744.             #define HIERARCHIAL      0x0100
  15745.             #define CASEINDEP        0x0020
  15746.             #define RESTORECURSOR    0x0010
  15747.             #define CURSORON         0x0008
  15748.             #define ERASEMENU        0x0004
  15749.             #define DISABLEOFF       0x0002
  15750.             #define WRAPAROUND       0x0001
  15751.   
  15752.        Internal menu flags:
  15753.   
  15754.             #define FIRSTTIME        0x01
  15755.   
  15756.        Menu command flags:
  15757.   
  15758.             #define ENABLED          0x00
  15759.             #define DISABLED         0x01
  15760.             #define NOTOPTION        0x02
  15761.             #define STATICTEXT       NOTOPTION
  15762.   
  15763.        Menuhk.h constants:
  15764.   
  15765.             #define MAXMENUCHOICES   23
  15766.   
  15767.   
  15768.  
  15769.  
  15770.  
  15771.  
  15772.  
  15773.  
  15774.  
  15775.  
  15776.  
  15777.  
  15778.  
  15779.  
  15780.  
  15781.      TCHK 2.0                                               Page 239
  15782.  
  15783.    Multihk.h
  15784.   ---------
  15785.   
  15786.        Multihk types:
  15787.   
  15788.             typedef struct DESQmemory {
  15789.                       int memavail;
  15790.                       int largestblockavail;
  15791.                       int totalmem;
  15792.                  };
  15793.   
  15794.    Printhk.h
  15795.   ---------
  15796.   
  15797.        Printhk constants:
  15798.   
  15799.             Print Screen constants. See printhk.h for more details.
  15800.             Print.com constants. See printhk.h for more details.
  15801.             Print.com error codes. See printhk.h for more details.
  15802.             #define PRTSC_STATUS     *((byte far *) 0x500lu)
  15803.   
  15804.    Video.h
  15805.   -------
  15806.   
  15807.        Video constants:
  15808.   
  15809.             #define VIDEO            0x10
  15810.             #define MODE             *((byte far *) 0x449lu)
  15811.             #define PAGE             *((byte far *) 0x462lu)
  15812.             #define PAGELEN          *((unsigned int far *) 0x44Clu)
  15813.             #define VIDOFFSET        *((unsigned int far *) 0x44Elu)
  15814.             #define ROWCOUNT         *((byte far *) 0x484lu)
  15815.             #define CHARHEIGHT       *((unsigned int far *) 0x485lu)
  15816.             #define CURSOR_UNDERBAR       (MODE==7)?0x0B0C:0x0607
  15817.             #define CURSOR_HALFBLOCK      (MODE==7)?0x070C:0x0407
  15818.   
  15819.   
  15820.   
  15821.                                VARIABLE TYPES
  15822.   
  15823.        The following variable types have been defined:
  15824.   
  15825.             bboolean = unsigned int  defined in TC.EXE. See Features.
  15826.             boolean = char           Howard.h
  15827.             byte = unsigned char     defined in TC.EXE. See Features.
  15828.             word = unsigned int      defined in TC.EXE. See Features.
  15829.             struct ddate             Datehk.h
  15830.             struct BiosParmBlock     Doshk.h
  15831.             struct BootBlock         Doshk.h
  15832.             struct filespec          Filehk.h
  15833.             struct fnameext          Filehk.h
  15834.             struct EMSrecord         Ibm.h
  15835.             struct DESQmemory        Multihk.h
  15836.   
  15837.  
  15838.  
  15839.  
  15840.  
  15841.  
  15842.  
  15843.  
  15844.  
  15845.  
  15846.  
  15847.      TCHK 2.0                                               Page 240
  15848.  
  15849.   
  15850.   
  15851.   
  15852.                               GLOBAL VARIABLES
  15853.   
  15854.        These variables are defined for one reason or another and used
  15855.        internally. None of these variables have to be initialized (see
  15856.        insertmode.) They are mainly used to return extra values found in
  15857.        certain functions or needed globally by other functions.
  15858.   
  15859.         Date variables:
  15860.   
  15861.             char *Days[7] = { "Sunday","Monday","Tuesday","Wednesday",
  15862.                               "Thursday","Friday","Saturday" };
  15863.             char *Months[12] = { "January","February","March","April",
  15864.                                  "May","June","July","August",
  15865.                                  "September","October","November",
  15866.                                  "December" };
  15867.             char *MonthAbbr[12] = { "Jan","Feb","Mar","Apr","May",
  15868.                                     "Jun","Jul","Aug","Sep","Oct",
  15869.                                     "Nov","Dec" };
  15870.             int daylist[13] = { 0, 31, 59, 90, 120, 151, 181, 212,
  15871.                                 243, 273, 304, 334, 365 };
  15872.   
  15873.        Note: daylist is a list of the day number of the year at the end
  15874.              of each month (i.e. April 1st is the 91st (Mar 31 = 90, +1) 
  15875.              day of the year.)
  15876.   
  15877.   
  15878.         Keyboard variables:
  15879.   
  15880.             boolean key_extended;    /* TRUE if special key pressed,
  15881.                                         i.e. Alt-X, etc. */
  15882.             int key_status;          /* shift key status byte */
  15883.   
  15884.        Note:  these variables are set by inkey() and getk(), and are
  15885.               checked by many other keyboard routines.
  15886.   
  15887.             boolean insertmode;      /* insert or overwrite mode? */
  15888.   
  15889.        Note:  This variable is used internally by getstr() and getget().
  15890.               Although getget() initializes this variable, getstr does
  15891.               NOT. You MUST set insertmode to TRUE or FALSE before
  15892.               calling getstr() or unpredictable results may occur. Upon
  15893.               completion of this function, testing this variable will
  15894.               determine the input mode last used. Future versions will
  15895.               default insertmode to some value if it has not been set.
  15896.   
  15897.   
  15898.         Multitasking variables:
  15899.   
  15900.             char _dvmajor;
  15901.             char _dvminor;
  15902.   
  15903.   
  15904.  
  15905.  
  15906.  
  15907.  
  15908.  
  15909.  
  15910.  
  15911.  
  15912.  
  15913.      TCHK 2.0                                               Page 241
  15914.  
  15915.   
  15916.         TCHK version variables:
  15917.   
  15918.             unsigned int _TCHKversion = 0x0200;
  15919.             unsigned char _TCHKmajor = 2;
  15920.             unsigned char _TCHKminor = 00;
  15921.             char *_TCHKdate = "12/03/88";
  15922.             char *_TCHK = "TCHK is Copyright (C) 1988 by Howard
  15923.                            Kapustein.  All rights reserved.";
  15924.   
  15925.   
  15926.         Video variables:
  15927.   
  15928.             FRAMES: see video.h for frame[] declarations.
  15929.   
  15930.             const char emptystring[] = "               ";
  15931.   
  15932.             Note: Do NOT alter this variable. emptystring[] is defined
  15933.                   as a string of 15 spaces and is used internally by
  15934.                   several functions. Altering this function can lead to
  15935.                   wildly unpredictable results.
  15936.   
  15937.             byte char_attribute;
  15938.   
  15939.             Note: This variable is used by many output functions to set
  15940.                   the attribute byte. For functions such as putstr() you
  15941.                   can either call set_color() with the attribute desired
  15942.                   or declare char_attribute as an extern and then set it
  15943.                   yourself.
  15944.   
  15945.   
  15946.   
  15947.   
  15948.  
  15949.  
  15950.  
  15951.  
  15952.  
  15953.  
  15954.  
  15955.  
  15956.  
  15957.  
  15958.  
  15959.  
  15960.  
  15961.  
  15962.  
  15963.  
  15964.  
  15965.  
  15966.  
  15967.  
  15968.  
  15969.  
  15970.  
  15971.  
  15972.  
  15973.  
  15974.  
  15975.  
  15976.  
  15977.  
  15978.  
  15979.      TCHK 2.0                                               Page 242
  15980.  
  15981.                               REVISION HISTORY
  15982.   
  15983.        Version 2.0  -  12-3-88
  15984.        -----------
  15985.        Compiled with Turbo C 2.0
  15986.        New functions:
  15987.          -  ansiback(), ansifore()
  15988.          -  DESQcommonmem(), DESQconvenmem(), DESQdispchar(), DESQexit(),
  15989.             DESQexpandedmem(), DESQInternalStack(), DESQMakeTone(),
  15990.             DESQProgramStack()
  15991.          -  DoubleDOSGetVirtual()
  15992.          -  EMSinfo(), EMSpages(), EMSwarmbootprep(), getEMSstatus()
  15993.          -  inkeyc()
  15994.          -  strclean(), strcapital(), strfill(), stroccur(),
  15995.             strtocomma(), strwcmp(), strwicmp()
  15996.          -  cpu_id(), ndp_id() (ndp_id() is not 100% bug free yet)
  15997.          -  diskchanged()
  15998.          -  isBlogical(), isgameport(), iskey102()
  15999.          -  CapsLock(), InsLock(), NumLock(), ScrollLock()
  16000.          -  tocapkey()
  16001.          -  accum_dep(), depreciation(), double_decline_bal_dep(),
  16002.             striaght_line_dep(), sum_year_digits_dep()
  16003.          -  FV(), FVa(), PMT(), PV(), PVa()
  16004.          -  average(), factorial(), stddev(), summation(), variance()
  16005.          -  frac(), round()
  16006.          -  expandfilespec(), fncmp(), getfilespec(), isdir(),
  16007.             parsefilename(), parsefnameext()
  16008.          -  beep()
  16009.          -  boxwindow()
  16010.          -  isPM(), to24hour(), tohour()
  16011.          -  time_convert()
  16012.          -  getcursor(), setcursor()
  16013.          -  color()
  16014.          -  read_attrib(), read_char()
  16015.          -  settextinfo()
  16016.          -  endstri(), endstrp()
  16017.          -  pause()
  16018.          -  print_screen()
  16019.          -  isPRINTavail(), PRINTadd(), PRINThold(), PRINTpurge(),
  16020.             PRINTremove(), PRINTresume()
  16021.          -  isAssignavail(), isAppendavail(), isShareavail(),
  16022.             isVidclock()
  16023.          -  getBootBlock(), getBPB()
  16024.          -  menu_popup(), popup_alloc(), popup_free(), popup_get()
  16025.          -  popup_restore(), popup_setcurrent(), pophilite(), popunlite()
  16026.          -  litebar_alloc(), litebar_free(), litebar_get()
  16027.          -  changelitebar(), litehilite(), litemessage(), liteunhilite()
  16028.          -  dosday(), doshour(), dosmonth(), dosmin(), dossec(),
  16029.             dosyear(), todosdate(), todostime()
  16030.          -  mid(), sqr(), swap()
  16031.          -  fsgn(), isgn(), lsgn()
  16032.          -  framebox[], emptystring[], _dvmajor, _dvminor, _TCHKversion,
  16033.             _TCHKmajor and _TCHKminor variables
  16034.   
  16035.   
  16036.  
  16037.  
  16038.  
  16039.  
  16040.  
  16041.  
  16042.  
  16043.  
  16044.  
  16045.      TCHK 2.0                                               Page 243
  16046.  
  16047.        Changes:
  16048.          -  screen coordinates format now (x,y) starting at (1,1)
  16049.          -  atrim(), ltrim() and rtrim() now modify the string passed to
  16050.             them
  16051.          -  box(), clear(), cls()
  16052.          -  ddatetolong() renamed to ddatetofull()
  16053.          -  EMMversion() modified
  16054.          -  getc_match(), getci_match() previously were getk_match() and
  16055.             getc_match()
  16056.          -  virtually all get...() functions now use Borland's console
  16057.             i/o routines
  16058.          -  gotoxy() renamed to gotohv()
  16059.          -  isBREAKon(), isVERIFYon(), setBREAK(), setVERIFY() are now
  16060.             #defines
  16061.   
  16062.        Removed:
  16063.          -  delay() removed
  16064.          -  isleap() removed
  16065.          -  restore_box(), restore_screen(), save_box(), save_screen()
  16066.             removed
  16067.          -  max() and min() #defines removed (Borland now supplies them)
  16068.   
  16069.        If I've missed a couple, forgive me. I think I got them all down,
  16070.        but with all the changes and additions, it's hard to be 100% sure.
  16071.   
  16072.        Note: The ndp(), menu_lotus() and lotus_setup() functions are not
  16073.              fully implemented yet. The ndp() seems to crash the machine,
  16074.              and I found something grievously wrong with the lotus
  16075.              functions while testing the demo. Due to previous
  16076.              commitments, I am forced to release the library with these
  16077.              defective functions. Look for the working versions in the
  16078.              next release.
  16079.   
  16080.   
  16081.   
  16082.        Version 1.5 - Internal release only
  16083.        -----------
  16084.   
  16085.   
  16086.        Version 1.0 - Internal release only
  16087.        -----------
  16088.   
  16089.   
  16090.        Version 0.70  -  2-17-88
  16091.        ------------
  16092.        New functions:
  16093.          - date_convert()
  16094.          - machine_id()
  16095.          - fname_match()
  16096.        I rewrote the License agreement after several conversations with
  16097.             Robert Blacher. He pointed out, rightly so, that the old
  16098.             licensing information was a bit confusing.
  16099.        Fixed a bug in shorttoddate() and fulltoddate(). These functions
  16100.             required a proper month abbreviation. If you had "Mau 12, 
  16101.  
  16102.  
  16103.  
  16104.  
  16105.  
  16106.  
  16107.  
  16108.  
  16109.  
  16110.  
  16111.      TCHK 2.0                                               Page 244
  16112.  
  16113.             1987" instead of "May 12, 1987" it would get stuck in an
  16114.             endless loop.
  16115.        Fixed a bug in some of the date conversion functions. A few
  16116.             functions refer to a list of the day number at the end of a
  16117.             month. This list (daylist[] in this version) listed Jun 30 as
  16118.             the 182nd day of the year instead of the 181st day of the
  16119.             year. The only inaccurate dates would be those occurring
  16120.             between July 1 and July 30, inclusive, and these would only
  16121.             be ahead by 1 day. Only those date functions with english in
  16122.             them (shorttoddate(), ddatetofull(), etc.) are affected.
  16123.        Found the proper way to check for DESQview. DESQversion() now
  16124.             returns the version of DESQview in the high and low order
  16125.             bytes. See DESQversion() for more details.
  16126.        Changed the #define BASE_JUL_YR to a double to prevent loss of
  16127.             significant digits warning message.
  16128.        Restructured the global variables. With version 0.70, most
  16129.             of the global variables are declared separately from the code
  16130.             itself. If you use, say, Months[], but nothing else, only
  16131.             Months[] will get linked in to your program instead of
  16132.             pulling a whole bunch of functions with it. When I get TC 1.5
  16133.             I hope to break up the functions even more.
  16134.        Added MonthAbbr[] and DayList[] global variables
  16135.        Fixed the disktype() function. It would plain not work. It would
  16136.             get a word and return a byte (the wrong byte, of course.) God
  16137.             curse all typos.
  16138.        Changed the DemoDisk sample program as well (no more DISK_ERROR,
  16139.             now it's DISK_INVALID. See the #define section for more
  16140.             details.)
  16141.        Expanded the list of Rom id bytes. See the #define section for
  16142.             more details.
  16143.        Cleaned up some typos in the documentation.
  16144.   
  16145.   
  16146.        Version 0.60  -  1-15-88
  16147.        ------------
  16148.        Over 30 new functions added:
  16149.          - Cal...(), Greg...(), Jul...(), fulltoddate(), shorttoddate()
  16150.          - dayofweek()
  16151.          - isBREAKon(), setBREAK()
  16152.          - isVERIFYon(), setVERIFY()
  16153.          - reboot()
  16154.          - isExtended(), Extendedtotal(), EMMversion()
  16155.          - isNetwork()
  16156.          - memory_strategy()
  16157.          - disktype()
  16158.          - set_handles()
  16159.          - DESQversion(), DESQfreeCPU()
  16160.          - isDoubleDOS(), DoubleDOSTaskSwitch(), DoubleDOSfreeCPU()
  16161.          - scrbuff()
  16162.          - cursor_blink()
  16163.          - ansi_call()
  16164.        Fixed a bug in isleapyear(). Previously, isleapyear() would
  16165.             determine years ending in 00 that were evenly divisible by 4
  16166.             to be leap years (i.e. 1600). The gregorian calendar (you 
  16167.  
  16168.  
  16169.  
  16170.  
  16171.  
  16172.  
  16173.  
  16174.  
  16175.  
  16176.  
  16177.      TCHK 2.0                                               Page 245
  16178.  
  16179.             know, 30 days hath September...) doesn't count those as leap
  16180.             years.
  16181.        Optimized the direct video access routines as well as possible
  16182.             using 100% C code. Previously they checked for vertical
  16183.             retrace. Now all direct accesses play with the video
  16184.             registers and other fun things, basically turning off the
  16185.             screen for a fraction of a second, performing the access,
  16186.             then turning the screen back on again. In the longer access
  16187.             functions (save_screen() to name one) I found changing 30
  16188.             bytes between screen blankings to be optimal. These changes
  16189.             have sped up the direct video access functions (putsay(),
  16190.             save_...(), restore_...()) by a factor or 3! These functions
  16191.             now take 1/3 the time they used to. If you find the screen to
  16192.             blink, or that there is snow (putsay() may experience
  16193.             miniscule snow when outputting long strings) please let me
  16194.             know and I'll see what I can do.
  16195.   
  16196.   
  16197.        Version 0.50  -  11-18-87
  16198.        ------------
  16199.        Initial release of TCHK
  16200.   
  16201.   
  16202.   
  16203.                             FUTURE ENHANCEMENTS
  16204.   
  16205.        There are more functions on the way. If you have any favorites you
  16206.        would like to see, or need, drop me a line. In future releases,
  16207.        look for the following features:
  16208.   
  16209.             -  fixing the ndp() function
  16210.             -  updating the Lotus style menus along the lines of the
  16211.                current popup and litebar menus
  16212.             -  enhancement of the get and put routines to support all
  16213.                features found in the @...SAY...GET commands of dBase III+
  16214.             -  keyboard routines using scan codes
  16215.             -  more menu interfaces (pulldown, hierarchial)
  16216.             -  mouse functions
  16217.             -  sound functions
  16218.             -  more EMS functions
  16219.             -  several math functions (integration, numerical methods, +)
  16220.             -  some more accounting functions to have a well rounded
  16221.                accounting library
  16222.             -  access to dBASE III+ files (.DBF, perhaps .NDX and .MEM)
  16223.             -  software id functions (TSR, ANSI.SYS, VDISK.SYS, etc.)
  16224.             -  direct screen accesses coded in assembler
  16225.             -  enhancement of the put routines to support the 'backslash'
  16226.                control characters like printf does (\n, \t, etc.)
  16227.             -  some more video routines
  16228.   
  16229.   
  16230.   
  16231.   
  16232.  
  16233.  
  16234.  
  16235.  
  16236.  
  16237.  
  16238.  
  16239.  
  16240.  
  16241.  
  16242.  
  16243.      TCHK 2.0                                               Page 246
  16244.  
  16245.                                OTHER PRODUCTS
  16246.   
  16247.        I am also the author of the following products:
  16248.   
  16249.        COOKIE 1.2  -  Fortune cookie, gives you a random fortune from a
  16250.                       cookie file. Lots of options and distributed with
  16251.                       2800 cookies of mixed content (rated G - X)
  16252.   
  16253.        DCOUNT 1.2  -  Document/Text file info, find out all kinds of
  16254.                       information like # words, lines, pages, control
  16255.                       characters, etc. Many options.
  16256.   
  16257.        FREE 1.4    -  Free disk space, with options. Distributed with
  16258.                       full Turbo C source.
  16259.   
  16260.        SF 3.01     -  Subtree Find, a powerful directory searcher. SF's
  16261.                       main claim to fame is being able to search a branch
  16262.                       of a disk directory, from a single directory to an
  16263.                       entire disk, 5%-250% faster than the leading file
  16264.                       finders! Other features include displaying more
  16265.                       information than DIR, delete files, color output,
  16266.                       pause during display, permanently modify options,
  16267.                       and much much more. Written in Turbo C 2.0.
  16268.   
  16269.   
  16270.   
  16271.                                   SUPPORT
  16272.   
  16273.   
  16274.        Thanks to the graciousness of the sysop at The BOSS, I now have
  16275.        easier access to his BBS. The latest versions of my software can
  16276.        be found there.
  16277.   
  16278.        If there are some features you would like to see implemented, or
  16279.        you have any questions or comments, please contact me. I can be
  16280.        reached at the following:
  16281.   
  16282.             HOME                          COLLEGE
  16283.             ────                          ───────
  16284.           Howard Kapustein              Howard Kapustein
  16285.           1695 Barbara Lane             404 Davison Hall
  16286.           East Meadow, NY 11554         Rensselaer Polytechnic Institute
  16287.           Phone: (516) 481-9612         Troy, NY 12180
  16288.                                         Phone: (518) 276-7381
  16289.   
  16290.        or at the following electronic services/bulletin boards:
  16291.   
  16292.             The Boss dBBS       (201) 568-7293   *** Support BBS ***
  16293.             Software Society    (201) 729-7410   Distribution BBS
  16294.             Computer Connection (202) 547-2008   Distribution BBS
  16295.   
  16296.   
  16297.        These are the places I can be reached by modem. TCHK (and all
  16298.        other software I release) is supported through The BOSS.
  16299.   
  16300.  
  16301.  
  16302.  
  16303.  
  16304.  
  16305.  
  16306.  
  16307.  
  16308.  
  16309.      TCHK 2.0                                               Page 247
  16310.  
  16311.   
  16312.        If you try to get in touch with me during the school year (roughly
  16313.        Sep 1 - May 10, not counting winter break of Xmas - Jan 15) PLEASE
  16314.        try to reach me at college. If you call my home odds are you won't
  16315.        get much information. My parents aren't exactly what you would
  16316.        call computer people.
  16317.   
  16318.   
  16319.  
  16320.  
  16321.  
  16322.  
  16323.  
  16324.  
  16325.  
  16326.  
  16327.  
  16328.  
  16329.  
  16330.  
  16331.  
  16332.  
  16333.  
  16334.  
  16335.  
  16336.  
  16337.  
  16338.  
  16339.  
  16340.  
  16341.  
  16342.  
  16343.  
  16344.  
  16345.  
  16346.  
  16347.  
  16348.  
  16349.  
  16350.  
  16351.  
  16352.  
  16353.  
  16354.  
  16355.  
  16356.  
  16357.  
  16358.  
  16359.  
  16360.  
  16361.  
  16362.  
  16363.  
  16364.  
  16365.  
  16366.  
  16367.  
  16368.  
  16369.  
  16370.  
  16371.  
  16372.  
  16373.  
  16374.  
  16375.      TCHK 2.0                                               Page 248
  16376.  
  16377.   
  16378.   
  16379.                          APPENDIX A - DATE FORMATS
  16380.   
  16381.        The following date formats are supported by TCHK:
  16382.   
  16383.        TCHK Reference      Date Type                Format
  16384.        --------------      ---------                ------
  16385.        Greg                Gregorian (US)           MM-DD-YY
  16386.        GregEuro            Gregorian (European)     DD-MM-YY
  16387.        GregJap             Gregorian (Japan)        YY-MM-DD
  16388.        Cal                 Calendar                 YYMMDD
  16389.        CalCent             Calendar (w/Century)     YYYYMMDD
  16390.        Jul                 Julian (Type E)          special hashed number
  16391.        JulA                Julian (Type A)          YYDDD
  16392.        JulB                Julian (Type B)          YYYYDDD
  16393.        full                English (Full)           Month DD, YYYY
  16394.        short               English (Short)          Mon DD, YYYY
  16395.        ddate               struct ddate             see datehk.h
  16396.   
  16397.        -  Gregorian units are common shorthand dates (in string format)
  16398.           with all leading zeros preserved
  16399.        -  Calendar units are numeric representations (double)
  16400.        -  Julian Type E is a special "magic" hashed number (double)
  16401.           representing the number of elapsed days since an initial date.
  16402.           Julian Type E numbers are valid for the years 1900-2100 (give
  16403.           or take a couple of months)
  16404.        -  Julian Type A and B are ANSI defined formats (double)
  16405.           containing year (and century for type B) and the day of the  
  16406.           year
  16407.        -  full are strings of the date with the full name of the month
  16408.        -  short are strings of the date with the short abbreviation of
  16409.           the month
  16410.        -  ddate is my own date structure defined in datehk.h
  16411.   
  16412.        In some instances date formats not specifically designed to hold
  16413.        the century may overflow. For example, converting CalCent
  16414.        formatted  20220401 (April 1, 2022) to Greg (MM-DD-YY) would
  16415.        result in the string "04-01-122". Be aware.
  16416.   
  16417.   
  16418.                             ! ! ! WARNING ! ! !
  16419.   
  16420.        Unless otherwise specified, date format conversion functions
  16421.        (GregtoCal, JulAtoddate, etc.) do NOT perform error checking. If
  16422.        you pass an invalid date (March 32, 1988) your result may be
  16423.        logically incorrect even though syntactically correct (Gregorian
  16424.        date of 03/32/88) or be totally corrupted.
  16425.   
  16426.        Julian Type E numbers are valid for the years 1900-2100 (give or
  16427.        take a couple of months.)
  16428.   
  16429.   
  16430.   
  16431.  
  16432.  
  16433.  
  16434.  
  16435.  
  16436.  
  16437.  
  16438.  
  16439.  
  16440.  
  16441.      TCHK 2.0                                               Page 249
  16442.  
  16443.   
  16444.   
  16445.                     APPENDIX B - date_convert() FORMATS
  16446.   
  16447.        The following formats are supported by date_convert():
  16448.   
  16449.        Type (id)    Data Type      Format              Notes
  16450.        ---------    ---------      ------              -----
  16451.            1        char           MM-DD-YY            US
  16452.            2         "             DD-MM-YY            Europe
  16453.            3         "             YY-MM-DD            Japan
  16454.   
  16455.            4        double         YYMMDD              Calendar
  16456.            5          "            YYYYMMDD               "     w/cent
  16457.            6          "            hashed              Julian Type E
  16458.            7          "            YYDDD                 "    Type A
  16459.            8          "            YYYYDDD               "    Type B
  16460.   
  16461.            9        struct date                        see dos.h
  16462.           10        struct ddate                       see datehk.h
  16463.   
  16464.           11        char           Mon DD, YYYY        short, no lead 0
  16465.           12         "             Month DD, YYYY      full, no lead 0
  16466.   
  16467.           13         "             MM/DD/YY            US
  16468.           14         "             DD/MM/YY            Europe
  16469.           15         "             YY/MM/DD            Japan
  16470.   
  16471.           16         "             MM-DD-YY            no lead 0
  16472.           17         "             DD-MM-YY                "
  16473.           18         "             YY-MM-DD                "
  16474.   
  16475.           19         "             MM/DD/YY            no lead 0
  16476.           20         "             DD/MM/YY                "
  16477.           21         "             YY/MM/DD                "
  16478.   
  16479.           22         "             MM-DD-YYYY          century
  16480.           23         "             DD-MM-YYYY             "
  16481.           24         "             YYYY-MM-DD             "
  16482.   
  16483.           25         "             MM/DD/YYYY          century
  16484.           26         "             DD/MM/YYYY             "
  16485.           27         "             YYYY/MM/DD             "
  16486.   
  16487.           28         "             MM-DD-YYYY          century, no lead 0
  16488.           29         "             DD-MM-YYYY                   "
  16489.           30         "             YYYY-MM-DD                   "
  16490.   
  16491.           31         "             MM/DD/YYYY          century, no lead 0
  16492.           32         "             DD/MM/YYYY                   "
  16493.           33         "             YYYY/MM/DD                   "
  16494.   
  16495.   
  16496.  
  16497.  
  16498.  
  16499.  
  16500.  
  16501.  
  16502.  
  16503.  
  16504.  
  16505.  
  16506.  
  16507.      TCHK 2.0                                               Page 250
  16508.  
  16509.           34        char           DD-MON-YY           
  16510.           35         "             DD-MON-YY           no lead 0
  16511.           36         "             DD-MON-YYYY         century
  16512.           37         "             DD-MON-YYYY            "    no lead 0
  16513.   
  16514.           38         "             Mon DD, YYYY        short
  16515.           39         "             Month DD, YYYY      full
  16516.   
  16517.           40         "             DD MON YY           
  16518.           41         "             DD MON YY           no lead 0
  16519.           42         "             DD MON YYYY         century
  16520.           43         "             DD MON YYYY            "    no lead 0
  16521.   
  16522.   
  16523.        Unless otherwise specified, a date format contains leading zeros.
  16524.   
  16525.        Refer to date_convert() for further specifications.
  16526.   
  16527.   
  16528.   
  16529.  
  16530.  
  16531.  
  16532.  
  16533.  
  16534.  
  16535.  
  16536.  
  16537.  
  16538.  
  16539.  
  16540.  
  16541.  
  16542.  
  16543.  
  16544.  
  16545.  
  16546.  
  16547.  
  16548.  
  16549.  
  16550.  
  16551.  
  16552.  
  16553.  
  16554.  
  16555.  
  16556.  
  16557.  
  16558.  
  16559.  
  16560.  
  16561.  
  16562.  
  16563.  
  16564.  
  16565.  
  16566.  
  16567.  
  16568.  
  16569.  
  16570.  
  16571.  
  16572.  
  16573.      TCHK 2.0                                               Page 251
  16574.  
  16575.   
  16576.   
  16577.                     APPENDIX C - time_convert() FORMATS
  16578.   
  16579.        The following formats are supported by time_convert():
  16580.   
  16581.        Type (id)    Data Type      Format              Notes
  16582.        ---------    ---------      ------              -----
  16583.            1        char           HH:MM AM            12-hour (h,m)
  16584.            2         "             HH:MM               24-hour (h,m)
  16585.            3         "             HH:MM:SS AM         12-hour (h,m,s)
  16586.            4         "             HH:MM:SS            24-hour (h,m,s)
  16587.            5         "             HH:MM:SS:CC AM      12-hour (h,m,s,u)
  16588.            6         "             HH:MM:SS:CC         24-hour (h,m,s,u)
  16589.   
  16590.            7        struct time                        see dos.h
  16591.   
  16592.            8        double                             1/100 seconds
  16593.            9          "                                seconds
  16594.           10          "                                minutes
  16595.           11          "                                hours
  16596.           12          "                                days
  16597.   
  16598.           13        char           HHhMMm              no leading zeros
  16599.           14         "             HHhMMmSSs           no leading zeros
  16600.           15         "             HHhMMmSSsCCc        no leading zeros
  16601.   
  16602.           16         "             0HH:MM AM           12-hour (0h,m)
  16603.           17         "             0HH:MM              24-hour (0h,m)
  16604.           18         "             0HH:MM:SS AM        12-hour (0h,m,s)
  16605.           19         "             0HH:MM:SS           24-hour (0h,m,s)
  16606.           20         "             0HH:MM:SS:CC AM     12-hour (0h,m,s,u)
  16607.           21         "             0HH:MM:SS:CC        24-hour (0h,m,s,u)
  16608.   
  16609.           22         "             0HHhMMm             all leading zeros
  16610.           23         "             0HHhMMmSSs          all leading zeros
  16611.           24         "             0HHhMMmSSsCCc       all leading zeros
  16612.   
  16613.   
  16614.        The notation H:M:S:C stands for hours:minutes:seconds:centiseconds
  16615.        (1/100 secs). The notation AM stands for AM or PM, as is
  16616.        appropriate.
  16617.   
  16618.        Unless otherwise specified, a time string contains leading zeros
  16619.        for all values except the hour. The notation 0H stands for hours
  16620.        containing leading zeros.
  16621.   
  16622.        Refer to time_convert() for further specifications.
  16623.   
  16624.   
  16625.   
  16626.  
  16627.  
  16628.  
  16629.  
  16630.  
  16631.  
  16632.  
  16633.  
  16634.  
  16635.  
  16636.  
  16637.  
  16638.  
  16639.      TCHK 2.0                                               Page 252
  16640.  
  16641.                                    Index
  16642.   
  16643.   
  16644.   _dvmajor                    240, 242
  16645.   _dvminor                    240, 242
  16646.   _TCHK                    241, 242
  16647.   _TCHKdate                241
  16648.   _TCHKmajor               241, 242
  16649.   _TCHKminor               241, 242
  16650.   _TCHKversion             241, 242
  16651.   
  16652.   A
  16653.   Accum_dep                1, 14, 44, 64, 201, 218, 235, 242
  16654.   Ansiback                 1, 16, 17, 18, 242
  16655.   Ansifore                 1, 16, 17, 18, 242
  16656.   Ansi_call                1, 15, 17, 18, 244
  16657.   Atrim                    1, 19, 243
  16658.   Average                  1, 20, 200, 219, 229, 242
  16659.   
  16660.   B
  16661.   Beep                     1, 21, 242
  16662.   BIOSParmBlock            85, 234
  16663.   BootBlock                84, 234, 239
  16664.   Box                      1, 10, 13, 22, 23, 24, 28, 104, 129, 130, 156,
  16665.                            187, 188, 230, 242, 243
  16666.   Boxwindow                1, 22, 23, 24, 129, 156, 242
  16667.   
  16668.   C
  16669.   Cal...                   1, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16670.                            213, 244
  16671.   CapsLock                 1, 26, 108, 150, 189, 242
  16672.   Changelitebar            1, 27, 132, 133, 134, 135, 136, 137, 242
  16673.   Char_attribute           104, 171, 172, 173, 190, 230, 241
  16674.   Clear                    1, 15, 28, 29, 30, 236, 243
  16675.   Clear                    1, 15, 28, 29, 30, 236, 243
  16676.   Clear_typeahead          1, 29, 236
  16677.   Cls                      1, 15, 28, 30, 243
  16678.   Color                    1, 3, 4, 5, 9, 10, 15, 16, 17, 18, 23, 31,
  16679.                            104, 113, 130, 135, 137, 143, 157, 163, 164,
  16680.                            171, 172, 173, 190, 230, 233, 241, 242, 246
  16681.   Cpu_id                   1, 32, 141, 149, 233, 242
  16682.   Cursor_blink             1, 33, 34, 35, 36, 88, 178, 191, 195, 244
  16683.   Cursor_flip              1, 33, 34, 35, 36, 88, 178, 191, 195
  16684.   Cursor_off               1, 33, 34, 35, 36, 88, 178, 191, 195
  16685.   Cursor_on                1, 33, 34, 35, 36, 88, 178, 191, 195
  16686.   
  16687.   D
  16688.   Date_convert             1, 6, 25, 37, 41, 42, 43, 81, 103, 127, 148,
  16689.                            198, 213, 243, 249, 250
  16690.   Daylist                  240, 244
  16691.   Dayofweek                1, 38, 39, 244
  16692.   Dayofyear                1, 39, 40, 55
  16693.   Days                     1, 39, 40, 43, 55, 120, 228, 233, 240, 245,
  16694.                            248, 251
  16695.   
  16696.  
  16697.  
  16698.  
  16699.  
  16700.  
  16701.  
  16702.  
  16703.  
  16704.  
  16705.      TCHK 2.0                                               Page 253
  16706.  
  16707.   Days                     240
  16708.   Daysleft                 1, 39, 40, 55
  16709.   Ddate                    1, 25, 37, 39, 40, 41, 42, 43, 55, 81, 103,
  16710.                            127, 148, 198, 213, 233, 239, 243, 244, 248,
  16711.                            249
  16712.   Ddatetofull              1, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16713.                            213, 243, 244
  16714.   Ddatetoshort             1, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16715.                            213
  16716.   Ddatetostr               1, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16717.                            213
  16718.   Depreciation             1, 14, 44, 64, 201, 218, 242
  16719.   DESQcommonmem            1, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16720.   DESQconvenmem            1, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16721.   DESQdispchar             1, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16722.   DESQexit                 1, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16723.   DESQexpandedmem          1, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16724.   DESQfreeCPU              2, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 244
  16725.   DESQInternalStack        2, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16726.   DESQMakeTone             2, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16727.   DESQmemory               45, 46, 49, 239
  16728.   DESQProgramStack         2, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 242
  16729.   DESQversion              2, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 244
  16730.   Diffddate                2, 39, 40, 55
  16731.   Diskchanged              2, 56, 57, 242
  16732.   Disktype                 2, 9, 56, 57, 244
  16733.   Dosday                   2, 58, 59, 60, 61, 62, 63, 225, 226, 242
  16734.   Doshour                  2, 58, 59, 60, 61, 62, 63, 225, 226, 242
  16735.   Dosmin                   2, 58, 59, 60, 61, 62, 63, 225, 226, 242
  16736.   Dosmonth                 2, 58, 59, 60, 61, 62, 63, 225, 226, 242
  16737.   Dossec                   2, 58, 59, 60, 61, 62, 63, 225, 226, 242
  16738.   Dosyear                  2, 58, 59, 60, 61, 62, 63, 225, 226, 242
  16739.   DoubleDOSfreeCPU         2, 65, 66, 67, 244
  16740.   DoubleDOSGetVirtual      2, 65, 66, 67, 242
  16741.   DoubleDOSTaskSwitch      2, 65, 66, 67, 244
  16742.   Double_decline_bal_dep   2, 14, 44, 64, 201, 218, 235, 242
  16743.   
  16744.   E
  16745.   EMMversion               2, 68, 69, 70, 71, 91, 115, 243, 244
  16746.   Emptystring              241, 242
  16747.   EMSinfo                  2, 69, 115, 242
  16748.   EMSpages                 2, 68, 69, 70, 71, 91, 115, 242
  16749.   EMSrecord                69, 70, 235, 239
  16750.   EMSwarmbootprep          2, 68, 69, 70, 71, 91, 115, 242
  16751.   Endstri                  2, 72, 73, 242
  16752.   Endstrp                  2, 73, 242
  16753.   Expandfilespec           2, 74, 242
  16754.   Extendedtotal            2, 75, 116, 244
  16755.   
  16756.   F
  16757.   Factorial                2, 76, 219, 242
  16758.   Filespec                 2, 12, 74, 92, 151, 152, 234, 239
  16759.   Fnameext                 153, 234, 239
  16760.   Fname_match              2, 77, 78, 243
  16761.   
  16762.  
  16763.  
  16764.  
  16765.  
  16766.  
  16767.  
  16768.  
  16769.  
  16770.  
  16771.      TCHK 2.0                                               Page 254
  16772.  
  16773.   Fncmp                    2, 77, 78, 242
  16774.   Frac                     2, 79, 184, 242, 245
  16775.   Fsgn                     2, 80, 118, 138, 236, 242
  16776.   Fulltoddate              2, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16777.                            213, 243, 244
  16778.   FV                       2, 82, 83, 155, 174, 175, 242
  16779.   FVa                      2, 82, 83, 155, 174, 175, 242
  16780.   
  16781.   G
  16782.   GetBootBlock             2, 84, 85, 242
  16783.   GetBPB                   2, 84, 85, 242
  16784.   Getci_match              2, 87, 98, 243
  16785.   Getcursor                2, 33, 34, 35, 36, 88, 178, 191, 195, 242
  16786.   Getc_match               2, 86, 87, 97, 98, 101, 105, 106, 243
  16787.   Getdatehk                2, 89
  16788.   Getdouble                2, 90, 96, 99
  16789.   GetEMSstatus             2, 68, 69, 70, 71, 91, 115, 242
  16790.   Getfilespec              2, 74, 92, 152, 153, 242
  16791.   Getfname                 2, 93
  16792.   Getget                   2, 93, 94, 100, 236, 240
  16793.   Getint                   2, 90, 96, 99
  16794.   Getk                     2, 86, 87, 97, 98, 101, 105, 106, 240, 243
  16795.   Getlogical               2, 86, 87, 97, 98, 101, 105, 106
  16796.   Getreal                  2, 90, 96, 99
  16797.   Getstr                   2, 95, 100, 240
  16798.   Getyn                    2, 86, 87, 97, 98, 101, 105, 106
  16799.   Gotohv                   2, 22, 28, 102, 171, 173, 231, 232, 243
  16800.   Greg...                  2, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16801.                            213, 244
  16802.   
  16803.   H
  16804.   Horiz_line               2, 22, 23, 104, 230
  16805.   
  16806.   I
  16807.   Inkey                    3, 29, 86, 87, 89, 90, 94, 95, 96, 97, 98, 99,
  16808.                            100, 101, 105, 106, 131, 157, 223, 240, 242
  16809.   Inkeyc                   3, 97, 98, 101, 105, 106, 131, 157, 223, 242
  16810.   Insertmode               236, 240
  16811.   InsLock                  3, 26, 108, 150, 189, 242
  16812.   Intlen                   3, 107
  16813.   IsAppendavail            3, 109, 110, 124, 242
  16814.   IsAssignavail            3, 109, 110, 124, 242
  16815.   IsBlogical               3, 111, 242
  16816.   IsBREAKon                3, 112, 125, 194, 197, 243, 244
  16817.   IsCGA                    3, 113
  16818.   Iscolor                  3, 113
  16819.   Isdir                    3, 74, 114, 242
  16820.   IsEGA                    3, 113
  16821.   IsEMSavail               3, 68, 69, 70, 71, 91, 115
  16822.   IsExtended               3, 75, 116, 244
  16823.   Isgameport               3, 117, 242
  16824.   Isgn                     3, 80, 118, 138, 236, 242
  16825.   IsHerc                   3, 113
  16826.   Iskey102                 3, 119, 242
  16827.   
  16828.  
  16829.  
  16830.  
  16831.  
  16832.  
  16833.  
  16834.  
  16835.  
  16836.  
  16837.      TCHK 2.0                                               Page 255
  16838.  
  16839.   Isleapyear               3, 37, 120, 228, 234, 244
  16840.   IsMDA                    3, 113
  16841.   Ismono                   3, 113
  16842.   IsNetwork                3, 121, 244
  16843.   IsPM                     3, 123, 224, 227, 242
  16844.   IsPRINTavail             3, 122, 165, 166, 167, 168, 169, 170, 242
  16845.   IsShareavail             3, 109, 110, 124, 242
  16846.   IsVERIFYon               3, 112, 125, 194, 197, 243, 244
  16847.   IsVidclock               3, 126, 242
  16848.   
  16849.   J
  16850.   Jul...                   3, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16851.                            213, 244
  16852.   
  16853.   K
  16854.   Keylist                  131, 238
  16855.   Key_extended             97, 240
  16856.   Key_status               97, 240
  16857.   
  16858.   L
  16859.   Leftstr                  3, 128, 147, 181
  16860.   Litebar_alloc            3, 27, 129, 133, 134, 135, 136, 137, 242
  16861.   Litebar_field            27, 237, 238
  16862.   Litebar_free             3, 27, 131, 132, 133, 134, 135, 136, 137, 242
  16863.   Litebar_get              3, 27, 131, 132, 133, 134, 135, 136, 137, 242
  16864.   Litebar_header           27, 129, 132, 133, 134, 135, 136, 137, 237
  16865.   Litehilite               3, 27, 132, 133, 134, 135, 136, 137, 242
  16866.   Litemessage              3, 27, 132, 133, 134, 135, 136, 137, 242
  16867.   Liteunlite               3, 132, 133, 134, 135, 136, 137
  16868.   Lotus_setup              3, 140, 144, 243
  16869.   Lsgn                     3, 80, 118, 138, 236, 242
  16870.   Ltrim                    3, 139, 243
  16871.   
  16872.   M
  16873.   Machine_id               3, 32, 141, 149, 182, 183, 243
  16874.   Memory_strategy          3, 142, 244
  16875.   Menu_lotus               3, 140, 143, 144, 243
  16876.   Menu_popup               3, 145, 158, 159, 160, 161, 162, 163, 164, 242
  16877.   Mid                      3, 128, 146, 147, 181, 224, 236, 242
  16878.   Midstr                   3, 128, 147, 181
  16879.   MonthAbbr                148, 240, 244
  16880.   Monthexpand              3, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16881.                            213
  16882.   Months                   148, 240, 244
  16883.   Months                   8, 43, 132, 148, 158, 233, 240, 244, 248
  16884.   
  16885.   N
  16886.   Ndp_id                   3, 32, 141, 149, 233, 242
  16887.   NumLock                  3, 26, 108, 150, 189, 242
  16888.   
  16889.   P
  16890.   Parsefilename            3, 74, 92, 151, 152, 153, 242
  16891.   Parsefnameext            3, 74, 92, 152, 153, 242
  16892.   Pause                    3, 154, 242, 246
  16893.   
  16894.  
  16895.  
  16896.  
  16897.  
  16898.  
  16899.  
  16900.  
  16901.  
  16902.  
  16903.      TCHK 2.0                                               Page 256
  16904.  
  16905.   PMT                      3, 82, 83, 155, 174, 175, 242
  16906.   Pophilite                4, 145, 158, 159, 160, 161, 162, 163, 164, 242
  16907.   Popunlite                4, 145, 158, 159, 160, 161, 162, 163, 164, 242
  16908.   Popup_alloc              3, 145, 156, 159, 160, 161, 162, 163, 164, 242
  16909.   Popup_field              237
  16910.   Popup_free               3, 145, 157, 158, 159, 160, 161, 162, 163,
  16911.                            164, 242
  16912.   Popup_get                3, 145, 157, 158, 159, 160, 161, 162, 163,
  16913.                            164, 242
  16914.   Popup_header             156, 158, 159, 160, 161, 162, 163, 164, 237
  16915.   Popup_restore            4, 145, 158, 159, 160, 161, 162, 163, 164, 242
  16916.   Popup_setcurrent         4, 145, 158, 159, 160, 161, 162, 163, 164, 242
  16917.   PRINTadd                 4, 122, 165, 166, 167, 168, 169, 170, 242
  16918.   PRINThold                4, 122, 165, 166, 167, 168, 169, 170, 242
  16919.   PRINTpurge               4, 122, 165, 166, 167, 168, 169, 170, 242
  16920.   PRINTremove              4, 122, 165, 166, 167, 168, 169, 170, 242
  16921.   PRINTresume              4, 122, 165, 166, 167, 168, 169, 170, 242
  16922.   Print_screen             4, 165, 242
  16923.   Putk                     4, 22, 28, 86, 171, 172, 173, 190
  16924.   Putsay                   4, 171, 172, 173, 245
  16925.   Putstr                   4, 98, 101, 171, 172, 173, 190, 241
  16926.   PV                       4, 82, 83, 155, 174, 175, 242
  16927.   PVa                      4, 82, 83, 155, 174, 175, 242
  16928.   
  16929.   R
  16930.   Read_attrib              4, 176, 177, 242
  16931.   Read_char                4, 176, 177, 242
  16932.   Read_cursor              4, 33, 34, 35, 36, 88, 102, 178, 191, 195,
  16933.                            231, 232
  16934.   Read_mode                4, 179, 193
  16935.   Reboot                   4, 10, 11, 180, 244
  16936.   Rightstr                 4, 128, 147, 181
  16937.   ROM_date                 4, 141, 182, 183
  16938.   ROM_id                   4, 141, 182, 183
  16939.   Round                    2, 4, 79, 184, 214, 242, 245
  16940.   Rtrim                    4, 185, 243
  16941.   
  16942.   S
  16943.   Scrbuff                  4, 23, 24, 186, 244
  16944.   ScrollLock               4, 26, 189, 242
  16945.   Scroll_down              4, 187, 188
  16946.   Scroll_up                4, 187, 188
  16947.   SetBREAK                 4, 112, 125, 194, 197, 243, 244
  16948.   Setcursor                4, 33, 34, 35, 36, 88, 178, 191, 195, 242
  16949.   Settextinfo              4, 131, 157, 196, 242
  16950.   SetVERIFY                4, 112, 125, 194, 197, 243, 244
  16951.   Set_color                4, 171, 172, 173, 190, 241
  16952.   Set_cursor               4, 33, 34, 35, 36, 88, 178, 191, 195
  16953.   Set_handles              4, 192, 244
  16954.   Set_mode                 4, 15, 179, 193
  16955.   Shorttoddate             4, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16956.                            213, 243, 244
  16957.   Sqr                      4, 199, 236, 242
  16958.   Stddev                   4, 20, 200, 219, 229, 242
  16959.   
  16960.  
  16961.  
  16962.  
  16963.  
  16964.  
  16965.  
  16966.  
  16967.  
  16968.  
  16969.      TCHK 2.0                                               Page 257
  16970.  
  16971.   Straight_line_dep        4, 14, 44, 64, 201, 218, 235
  16972.   Strcapital               4, 202, 242
  16973.   Strclean                 4, 203, 242
  16974.   Strcomma                 4, 107, 204, 212
  16975.   Strdel                   4, 205
  16976.   Strfill                  4, 206, 242
  16977.   Strins                   4, 207
  16978.   Stroccur                 4, 208, 242
  16979.   Strrep                   4, 206, 209
  16980.   Strshleft                4, 210
  16981.   Strshright               4, 211
  16982.   Strtocomma               4, 204, 212, 242
  16983.   Strtoddate               4, 25, 37, 41, 42, 43, 81, 103, 127, 148, 198,
  16984.                            213
  16985.   Strtodol                 4, 214
  16986.   Strtotime                5, 215, 221, 222
  16987.   Strwcmp                  5, 216, 217, 242
  16988.   Strwicmp                 5, 216, 217, 242
  16989.   Summation                5, 20, 76, 200, 219, 229, 242
  16990.   Sum_year_digits_dep      5, 14, 44, 64, 201, 218, 235, 242
  16991.   Swap                     5, 220, 236, 242
  16992.   
  16993.   T
  16994.   Timetostr                5, 215, 221, 222
  16995.   Time_convert             5, 6, 123, 221, 224, 227, 242, 251
  16996.   To24hour                 5, 123, 224, 227, 242
  16997.   Tocapkey                 5, 105, 106, 223, 242
  16998.   Todosdate                5, 58, 59, 60, 61, 62, 63, 225, 226, 242
  16999.   Todostime                5, 58, 59, 60, 61, 62, 63, 225, 226, 242
  17000.   Tohour                   5, 123, 224, 227, 242
  17001.   
  17002.   V
  17003.   Valid_date               5, 120, 228
  17004.   Variance                 5, 20, 200, 219, 229, 242
  17005.   Vert_line                5, 22, 23, 104, 230
  17006.   
  17007.   W
  17008.   Whereh                   5, 102, 178, 231, 232
  17009.   Wherev                   5, 102, 178, 231, 232
  17010.   
  17011.  
  17012.  
  17013.  
  17014.  
  17015.  
  17016.  
  17017.  
  17018.  
  17019.  
  17020.  
  17021.  
  17022.  
  17023.  
  17024.  
  17025.  
  17026.  
  17027.  
  17028.  
  17029.  
  17030.  
  17031.  
  17032.  
  17033.  
  17034.  
  17035.      TCHK 2.0                                               Page 258
  17036.  
  17037.   
  17038.   Function          
  17039.   
  17040.   Syntax            
  17041.   
  17042.   Prototype in      
  17043.   
  17044.   Remarks           
  17045.   
  17046.   Return value      
  17047.   
  17048.   Note              
  17049.   
  17050.   See also          
  17051.   
  17052.   Example           
  17053.   
  17054.   Program output    
  17055.   
  17056.   
  17057.  
  17058.  
  17059.  
  17060.  
  17061.  
  17062.  
  17063.  
  17064.  
  17065.  
  17066.  
  17067.  
  17068.  
  17069.  
  17070.  
  17071.  
  17072.  
  17073.  
  17074.  
  17075.  
  17076.  
  17077.  
  17078.  
  17079.  
  17080.  
  17081.  
  17082.  
  17083.  
  17084.  
  17085.  
  17086.  
  17087.  
  17088.  
  17089.  
  17090.  
  17091.  
  17092.  
  17093.  
  17094.  
  17095.  
  17096.  
  17097.